I've been working with Open-CV for a few weeks now. I'm trying to figure out how to rotate the perspective of this image so the black strap is perfectly straight up and down. I'm also trying to remove the white background from image, so the black strap is the only thing remaining. (The white holes can stay)
I modified my image in paint.net to show you what I want the image to eventually look like.
I have multiple similar images with straps that have slightly different angles. I am looking for an algorithm that will rotate and crop my images no matter the angle.The majority of the code examples I find online are written in python and I would prefer to continue to use c++. Any help of any kind to help me get started would be greatly appreciated. Thanks.