Need imitate GIMP Image/Crop to content function using OpenCV library.
Result needed: no border crossing upper/lower and left/right corner.
Please find sample below:
Code which might be close to what would I need is below:
Mat image = imread("somePath.bmp"); image(Rect(Point(0, 10), Point(10, 0))).copyTo(cropped_image); imshow("cropped_image", cropped_image);
I can’t use it as I dont know rectangle size and my images always have different size,but have similar pattern