권동기
권동기

Reputation: 1

how to get the next 2Dpoint in the frame

I use opencv & Notebook Camera. So I want to find four special object. I had solved it. So I get four 2DPoint. At the next frame, I find four 2DPoint of object. But I want to match 2DPoint of first frame to 2DPoint of second frame. All object light white light. Looking forward your positive reply.

Upvotes: -1

Views: 43

Answers (1)

Humam Helfawi
Humam Helfawi

Reputation: 20264

If you have a four points of your object you can use Optical-Flow.

std::vector<cv::Point> prev{p1,p2,p3,p4};
std::vector<cv::Point> next;
cv::calcOpticalFlowPyrLK(
  mat_prev, mat_next, 
  prev,
  next, 
  status, 
  err  
);

Documentation

Upvotes: 1

Related Questions