How to measure width of the strip lines from an image?
6 views (last 30 days)
Show older comments
The black and white strips are not necessarily vertical. It can be in any angle. I want to calculate the widths of both black and white strips.Thank you in advance.
3 Comments
Sanket Salvi
on 29 Jul 2019
Please, let me know if you got the solution..i am looking for same thing
Accepted Answer
KSSV
on 25 Jun 2019
I = imread('P_20190617_135833_vHDR_On.jpg') ;
I1 = rgb2gray(I) ;
I2 = imbinarize(I1) ;
[y,x] = find(I2) ;
% Get bounding box
idx = boundary(x,y) ;
R = [x(idx) y(idx)] ;
imshow(I)
hold on
plot(x,y,'.r')
plot(R(:,1),R(:,2),'g')
Now you have all the points and the boundary of the points. YOu can get what you want. There might be more elegant solution possible than this.
0 Comments
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!