I\'m using the code from the page. It works very well and I get a circle that I am looking for. All my image have only 1 circle and I have modified parameters of HoughCirc
HoughCirc
You can define a Region of Interest (ROI) on your image based on the coordinates of the circle, then imwrite will only save the cropped portion:
imwrite
cv::Rect roi(x, y, w, h); // I let you do the math ;) cv::Mat cropped = original(roi); cv::imwrite("cropped.png", cropped);