How can i extract vertical lines from the print given?
Mostra commenti meno recenti
I want to extract only the verticle lines which might be present in the lip print given using only morphological operations. Is there any preprocessing required before doing so?


Risposte (1)
Image Analyst
il 11 Feb 2017
You can use bwareaopen() to get rid of the large blobs. Then get rid of horizontal lines using
windowWidth = 5; % Whatever...some odd number.
verticalLines = imerode(binaryImage, ones(windowWidth, 1));
7 Commenti
PP
il 16 Feb 2017
Image Analyst
il 16 Feb 2017
If you don't like 5, change it to whatever works. What is your definition of a vertical line? There are very very few perfectly vertical lines, but lots of irregularly shaped blobs and spider shaped blobs. So how do you define it? By bounding box aspect ratio?
PP
il 20 Feb 2017
Image Analyst
il 20 Feb 2017
Since you have black on the very top row and the very bottom row, the vertical height would simply be the number of rows in the image:
[rows, columns, numColorChannels] = size(yourImage);
or more generally
verticalProfile = mean(yourImage, 2);
topRow = find(verticalProfile < 255, 1, 'first');
bottomRow = find(verticalProfile < 255, 1, 'last');
height = bottomRow - topRow; % optionally add 1 if you want.
PP
il 23 Feb 2017
Image Analyst
il 23 Feb 2017
That's what the second, more general snippet of code does.
PP
il 23 Feb 2017
Categorie
Scopri di più su Read, Write, and Modify Image 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!