Home How to label separate lines in the image (image of a text) separately using "bwlabel" in matlab?
 I have recognized and labeled objects in my image that is fully consists of texts. you can see the objects are labeled as red color in the attached image. so, I want to separate the objects in the second line (or more lines) from the first line and give them different colors (each line would has a different colors) but I can't do that. do you have any idea? thanks for all answers. this is part of my matlab code that does the labeling: %% Label connected components [L, Ne]=bwlabel(imagen); %% Measure properties of image regions propied=regionprops(L,'BoundingBox'); hold on %% Plot Bounding Box for n=1:size(propied,1) rectangle('Position',propied(n).BoundingBox,'EdgeColor','r','LineWidth',2) end  and this is labeled image that all the objects in different lines have the same label (same color=red).