I have two points in an image, centre left eye (X, Y) and centre right eye (X, Y). I have drawn circles around both eyes using cv::circle
, and this is fine. But what I'm now trying to do is get the ROI of the circles I've drawn, i.e. extract the eyes and save them in a new Mat.
This is my current result:
...But as I said above, just need to work on extracting the circles around the eyes into a new Mat, one for each eye.
This is my code:
cv::Mat plotImage;
plotImage = cv::imread("C:/temp/face.jpg", cv::IMREAD_COLOR);
cv::Point leftEye(person.GetLeftEyePoint().X, person.GetLeftEyePoint().Y);
cv::Point rightEye(person.GetRightEyePoint().X, person.GetRightEyePoint().Y);
cv::circle(plotImage, leftEye, 15, cv::Scalar(255, 255));
cv::circle(plotImage, rightEye, 15, cv::Scalar(255, 255));
cv::imwrite("C:\\temp\\plotImg.jpg", plotImage);
I've found the following links, but I can't seem to make sense of them/apply them to what I'm trying to do: http://answers.opencv.org/question/18784/crop-image-using-hough-circle/
Define image ROI with OpenCV in C
Any help/guidance is appreciated! Thank you!