필터 지우기
필터 지우기

How to find the next position of an object in an image based on the displacement of nearby objects?

조회 수: 3 (최근 30일)
I have 2 images, or let's say 2 frames( first one: reference image) obtained from a shaky video. The second frame is different from the first because of the vibration/shake. I want to find the pixel position of an object in the 2nd frame using the displacement/ distance between the pixels of other objects(like some markers) in these images.
What I did is I calculate the distance between the pixel positions of selected points in the 1st and 2nd images(same objects). But this distance are not the same and i cannot make an equation using this distance to find the (x2,y2) co-ordinates of the required object. How can I proceed further?
%%Input video file which needs to be stabilized.
filename = 'SS-75_zoom_Trim.mp4';
videoFReader = vision.VideoFileReader(filename, ...
'ImageColorSpace', 'RGB',...
'VideoOutputDataType', 'double');
%Create a video player object to play the video file
videoPlayer = vision.VideoPlayer;
img1=step(videoFReader); % obtain the first frame
img2=step(videoFReader); % second frame
figure;
imshow(img18);
[Ax,Ay] = getpts; %select points in image 1
figure;
imshow(img19);
[Bx,By] = getpts; %select the same point sin image 2
for i=1:3
dis(i) = hypot((Bx(i)-Ax(i)), (By(i)-Ay(i))); % calculate distance
end

답변 (1개)

Image Analyst
Image Analyst 2018년 9월 9일
Try imregister() or imtranslate().

카테고리

Help CenterFile Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by