How to measure width of the strip lines from an image?

6 views (last 30 days)
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
Krishnendu Bera
Krishnendu Bera on 25 Jun 2019
Dear Image Analyst,
Thank you for your quick comment. I can get a better resolution image. But how can I do it? what should be the aproach? Thanks again.
Sanket Salvi
Sanket Salvi on 29 Jul 2019
Please, let me know if you got the solution..i am looking for same thing

Sign in to comment.

Accepted Answer

KSSV
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.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!