Reputation: 2134
I have vector of points i drawed by my self :
std::vector<CvPoint> shape1 = paintshape(0);
Now i need to get a bounding box object (points) around this shape ,
i have searched the web for answeres but every topic is talking about recognizing the edge of some object inside whol image file and then making the bounding box.
in my case its different ,
Thanks !
Upvotes: 5
Views: 12668
Reputation: 39796
get the boundingRect for your points:
#include "opencv2/imgproc/imgproc.hpp"
// please use stuff from the cv:: namespace, not the outdated Cv*
std::vector<cv::Point> shape1 = paintshape(0);
cv::Rect r = cv::boundingRect(shape1);
Upvotes: 9