Find distance between foregrounds of two binary images
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
KALYAN ACHARJYA
le 16 Sep 2020
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
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!