
In the above image, we can see the point that is drawn on the image by some openCV algorithm .
I want to draw a UIView point at these points so that the user can crop it.
I do not get how I will access these points to add UIView points.
I tried to read cv::Point , but the value just differs (more) from the height and width of the coordinates.
static cv::Mat drawSquares( cv::Mat& image, const std::vector<std::vector<cv::Point> >& squares ) { int max_X=0,max_Y=0; int min_X=999,min_Y=999; for( size_t i = 0; i < squares.size(); i++ ) { const cv::Point* p = &squares[i][0]; int n = (int)squares[i].size(); NSLog(@"Squares%d %d %d",n,p->x,p->y); polylines(image, &p, &n, 1, true, cv::Scalar(0,255,0), 3, cv::LINE_AA); } return image; }
In the above code, the drawsquare method draws squares. I have NSLog coordinates of the x, y point, but these values ββare not wrt for the device coordinate system.
Can someone help me how this can be achieved Or an alternative to my requirement.
thanks
source share