I use OpenCV library for drawing circles on image.
I need to erase last circle which was drawn on window by clicking on right button click.
Currently, I wrote workaround, I replace red circle by white.
but seems there is another solution such as erase it.
How I can update my UI?
std::vector<Point2f> right_image; // stores 4 points that the user clicks(mouse left click) in the main image.
if (e == EVENT_RBUTTONDOWN && right_image.size() > 0) {
float x0 = right_image[right_image.size()-1].x;
float y0 = right_image[right_image.size()-1].y;
cv::circle(dispImg, cv::Point(x0, y0), 10, cv::Scalar(255, 255, 255), 3);
cv::imshow(cv::String(fullWindowName), dispImg);
right_image.pop_back();
}
question from:
https://stackoverflow.com/questions/65651652/how-to-erase-cvcircle-from-display-window 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…