简体   繁体   中英

Matching scaled and translated binary mask to noisy image of 2d object in MATLAB

So I have a matrix A 300x500 which contains binary image of some object (background 0 , object 1 ), and noisy image B with depicted the same object. I want to match binary mask A to the image B . Object on the mask has exactly the same shape as object on the noisy image. The problem is that images have different sizes (both of their planes and the objects depicted on them). Moreover the object on mask is located in the middle of the plane, contrary, on the image B is translated. Does anyone now simple solution how can I match these images?

Provided you don't rotate or scale your object the peak in cross-correlation should give you the shift between the two objects.

From the signal prcessing toolbox you can use xcorr2(A, B) to do this. The help even has it as one of the examples.

The peak position indicates the offset to get from one to the other. The fact that one indut is noisy will introduce some uncertainty in your answer, but this is inevitable as they do not exactly match.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM