Engine
Engine

Reputation: 5422

Drawing a quad in opencv

I have the coordinates of 4 points, and I want to to draw a quad based on those coordinates in opencv! is there in function that can based on those point draw a region! I know that rect can do that but I know I'll not always have a rectangle!

Upvotes: 0

Views: 1598

Answers (2)

Engine
Engine

Reputation: 5422

So I found and it works ;)

cv::fillConvexPoly(covered,cropped,cv::Scalar(255,255,255));

were covered is my frame and cropped is the vector of points, and if you don't get a rectangle form try to reorder the vector

Upvotes: 0

bkausbk
bkausbk

Reputation: 2790

I would suggest to use polygon drawing with polylines or fillPoly see drawing functions for more information.

Upvotes: 3

Related Questions