Problems with segments in an image
Mostra commenti meno recenti
I'm working on a project that involves character recognition. If I load an image that has for example the letters A, B, C, D, my program finds the regions and does some operations on it to get rid of vertical and horizontal white lines and also re-sizes the image to a pre-defined size. This works fine. However, if I load an image up that has one letter for example A, the bwlabel segments the image into 4 regions because that's the minimum number of regions it can have. I need to be able to code some logic that will help with this.
Here is the procedure that I have developed thus far (it has problems). num is the number of regions in the image from bwlabel. Ibw is the logical matrix for the image. Iprops is a structured array of properties for each region. Each row is a region.
grid_size = [10, 10];
[r c] = size(Iprops);
if num == 4 && num == r %single character recognition
segments = imresize(Ibw, grid_size, 'bicubic');
segments = segments(:)';
end
The problem with this code lies in the use of num == r. An image of one letter will return the same number of properties as an image of 4 letters. I need to modify my logic to account for this.
Edit: Now that I think of it, if I can determine if any regions overlap I could include that in my logic statement. The questions arise though, how can I check if any regions overlap?
3 Commenti
Image Analyst
il 21 Apr 2013
We can't help you unless you post your image somewhere (try snag.gy website). I have trouble understanding what you're saying and an image might help. For example I don't know why bwlabel "segments the image into 4 regions because that's the minimum number of regions it can have."
Harold
il 22 Apr 2013
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Image Segmentation in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!