OpenCV Transform Shape with Arbitrary Contour into Rectangle

asked 2019-05-04 12:41:25 -0500

ahmetozlu gravatar image

I want to perform book dewarping, the source image is like that:

image description

When I perform the 4 points OpenCV getperspective transform, the result looks like that:

image description

But I have to get rid of the v shape it appears on top part of the book page is given above...

As a summary, I need to perform transform shape with arbitrary contour into rectangle. Are there any algorithms for this in OpenCV?

I need something like this:

image description

edit retag flag offensive close merge delete


sturkmen gravatar imagesturkmen ( 2019-05-04 12:50:12 -0500 )edit

thanks for your reply but I already tried it however it did not work for my case, you can see the result for the input image I gave at the top of this page: https://user-images.githubusercontent...

ahmetozlu gravatar imageahmetozlu ( 2019-05-04 13:01:58 -0500 )edit

could you share the code you used so far and the original image

sturkmen gravatar imagesturkmen ( 2019-05-04 14:38:12 -0500 )edit
LiorA gravatar imageLiorA ( 2019-05-04 15:14:22 -0500 )edit