I need to find largest rectangle in a image, but when I find contours shadow becomes part of the contour.
Any suggestions how to remove/minimize shadow.
Original image
Image with contours
I need to find largest rectangle in a image, but when I find contours shadow becomes part of the contour.
Any suggestions how to remove/minimize shadow.
Original image
Image with contours
Copyright © 2021 Jogjafile Inc.
You can use an edge dectector like Canny:
With result:
After that you can have a go with cv::findContours() to find the rectangles.