- opticalFlow object: https://www.mathworks.com/help/vision/ref/opticalflowobject.html
- estimateFlow: https://www.mathworks.com/help/vision/ref/opticalflowhs.estimateflow.html
- opticalflowfarneback: https://www.mathworks.com/help/vision/ref/opticalflowfarneback.html
Find coordinates of closest points in successive frames
조회 수: 4 (최근 30일)
이전 댓글 표시
I have a sequence of 10 images (Siemen star). I want to find the coordinates of points which overlap as I proceed in time (going from one frame to other). How to find the closest points that were within some distance of each other or were overlaping with each other as I proceed the frames? Thanks! ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/663900/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/663900/image.png)
댓글 수: 0
답변 (1개)
Jaynik
2024년 4월 17일
Hi,
You can use the opticalFlow object to track motion between two frames. There are several functions to compute optical flow like opticalFlowLK for the Lucas-Kanade method, opticalFlowFarneback for the Farneback method, etc. You can try the method appropriate for your case.
Here is a sample code to estimate the optical flow between two frames:
% Convert the images to grayscale if necessary using rgb2gray
img1 = imread('image1.jpg');
opticFlow = opticalFlowFarneback;
flow = estimateFlow(opticFlow, img1);
for i = 2:10 % For 10 images
img2 = imread(sprintf('image%d.jpg', i));
% Estimate the optical flow between the current and the next frame
flow = estimateFlow(opticFlow, img2);
end
You can analyze the "flow.Magnitude" and "flow.Orientation" fields to find the overlapping points or points that are within a certain distance of their previous positions.
Please refer the following documentation links to read more about each functions:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tracking and Motion Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!