Hey guys! I'm new on matlab and I'm trying to do one thing, but I do not get it. The problem is that, for example, imagine there is a table and we take a photo. After this we put some element above the table ,for example, an apple and we take another photo. So, the question is, How can I determine the ROI (Region Of Interest) from the difference between the two images?
I was reading about roifilt2, roicolor... but I do not know how to apply that to it.
Thank you, kss!! =)

 채택된 답변

Image Analyst
Image Analyst 2015년 5월 3일

1 개 추천

Try simply subtracting the images.
diffImage = double(image1) - double(image2);
imshow(diffImage, []);
Casting to double is important otherwise you will never get negative numbers. Also, the [] in imshow() lets you see both positive and negative numbers. If you want a binary image and have a color image, then you can use the max function, something like
diffImage = max(abs(diffImage), [], 3) % For a color image.
Nothing more to do for a gray scale image. Then
binaryImage = abs(diffImage) > 5; % Or whatever number works.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

질문:

2015년 5월 3일

답변:

2015년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by