Find distance between foregrounds of two binary images
조회 수: 4 (최근 30일)
이전 댓글 표시
I have an image that looks like this:
I found the colored lines using hough transform.
I would now like to measure the width of the corresponding thick lines in the image.
I can draw a second image based on the Hough lines (the sizes of the images are equal, looks different here because they are screenshots):
So my basic idea is using something similar to bwdist to calculate the distance between all points in image one to those in image 2.
Any ideas?
댓글 수: 0
답변 (1개)
KALYAN ACHARJYA
2020년 9월 16일
Steps:
1.As you already know the indices of all three lines from the 2nd image. If not following is the way
[r2 c2]=find(image2==1);
2. Next force the all pixel with zero of r2 and c2 in 1st image. the find the indices the all white pixel in first image
[r1 c1]=find(image1==1);
3. Calculate the distances between all sets of [r1,c1] and [r2,c2]. Tou can proceed the first index pair of (r2,c2) with all indices pair in image 1, which are [r1,c1]. Next another index pair of (r2,c2) with all indices pair in image1..so on
At last you will get the distances between all three lines and all other white pixels in the image.
Hope it helps!
Kalyan
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!