Neighborhood filtering of different images

2 ビュー (過去 30 日間)
Jihye Jung
Jihye Jung 2019 年 10 月 8 日
回答済み: Sid Singh 2019 年 10 月 22 日
Hello, I have this grayvalue image.
I got 2 different images from sensor, and I sort centroids of reference (red x) and distroted image (green x).
I overlays reference centroids (red x) on distorted image (green x).
But I have trouble to calculate differences between centroids because I have different matrix size of centroids of reference and distorted images.
For the reference image, I got (160 x 2). / For the distorted image, I got (163 x 2).
I attached sortedcentroids1 (reference) and sortedcentroids2 (distorted).
area_compare spots.bmp
I want to filter out the centroids by using neighborhood filter within certain area, but I have no idea to do this.
I only tried like this to make a function, but it is not related to the neighborhood detection.
Can someone please provide a good idea for me to solve this problem?
else numel(sortedcentroids1(:,1)) < numel(sortedcentroids2(:,1))
f = find(abs(sortedcentroids2(1:numel(sortedcentroids1(:,1)),2)-...
sortedcentroids1(:,2))>100);
sortedcentroids2(f(1),:)=[];

回答 (1 件)

Sid Singh
Sid Singh 2019 年 10 月 22 日
Hi, you can use knnsearch to find the nearest neighbours to reference centroids. In your case, distorted points are missing for some reference points and vice versa but some points are very close for which I hope you want to compute the difference.
After doing the 1 nearest neighbour search for every reference point, threshold out those which are too far from normal and take the difference of the remaining points.

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by