Line detect the length of a pixel in image processing
6 views (last 30 days)
Show older comments
Hi, I have one image with a lot of vertical lines. I want to know number of lines and length of each of the lines. Please help me. Thanks
2 Comments
Image Analyst
on 29 Jun 2014
Here's some help: http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer
Usually when people want advice on image analysis, they attach and image. That would explain a lot, like whether the image is gray scale, color, computer graphics, blurry, lines are wiggly, etc. What can we say until we see your image?
Accepted Answer
Image Analyst
on 29 Jun 2014
There are thousands of vertical lines there, if you call a vertical line a series of white pixels in a single column with no breaks in it. You can count them simply by labeling the image using 4-connectivity
[labeledImage, numberOfRegions] = bwlabel(binaryImage, 4);
Now, some of those white blobs may be horizontal, or rounded blobs, so you might want to call regionprops and check the PixelIdxList property to make sure all the pixels in each blob are in the same column. Use unique on the x (column) coordinates for that.
4 Comments
More Answers (0)
See Also
Categories
Find more on Computer Vision with Simulink in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!