Measuring the distance to specific pixels
1 次查看(过去 30 天)
显示 更早的评论
In `matlab`, I know that I can calculate the distance between points (i.e; pixels) between two images using `pdist`.
But, the case I'm having is follows:
- I have created a matrix of `zeros` that has the same dimension of the original image I want to calculate the distance to. The reason I used the same dimension is since that `pdist` requires that the two objects you want to compare be of the same size. - At each iteration, based on some criteria, I add assign `1` to that pixel in the `zeros` matrix matrix that matches the criteria. - Before I end the iteration, I calculate the distance between the original image and the new image (zeros matrix with the added pixel(s)).
As you can see, I'm comparing two whole images at the time where I don't need to compare the whole second image (zeros image), where I'm interested only in measuring the distance to the pixels only having the value of `1` and not to the other part of the image where pixels are of value `0`.
How can I calculate the distance from the original image to the second image but only to the pixels having the value of `1`?
Thanks.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Segmentation and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!