简体   繁体   中英

How can I draw bounding boxes to image in matlab?

Here is what I did and want. I have two images with small differences. In the case of same resolution and position, to detect difference is simple. Just subtracting two images. Then the subtracted image has only different points valid. How can I draw bounding boxes to those differences? Is there any function to do it in matlab?

Given a set of 2D points X where the images are different, you can draw the bounding box on top of your image as follows.

imshow(I)
hold on
rectangle('Position', [min(X) (max(X)-min(X))])
hold off

(Depending on the data format, some transposes ' may be needed.)

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