0

I have 3 versions of webcomic page. First one is English black and white, secound is English colored by fans (these are same size), and third is black and white Polish translation where editors resized and moved content inside frame.

https://i.stack.imgur.com/4asrn.jpg

I want to create colored Polish version. The problem is what editors did. Width and Height of content is different, it's moved up inside frame and whole resolution of image is different than in orginal.

In few pages of webcomic polish version had same format, and all I had to do was to find diffs between polish and english version and then overlay them to colored one. (The only difference was text inside speech bubble and when I overlayed it to colored one I got polish colored version).

But I have no idea of how to solve it for these resized and moved ones.

I'm not familiar with OpenCV, I hadn't used this since small university project in 2011. But I guess that it's possible to solve my problem with this library.

Any tips of how to solve this, and what features of OpenCV should I learn?

wapean
  • 26
  • 2
  • Welcome to Stack Overflow. Please take the **tour** (https://stackoverflow.com/tour) and read the information guides in the **help center** (https://stackoverflow.com/help), in particular, "How to Ask A Good Question" (https://stackoverflow.com/help/how-to-ask), "What Are Good Topics" (https://stackoverflow.com/help/on-topic) and "How to create a Minimal, Reproducible Example" (https://stackoverflow.com/help/minimal-reproducible-example). – fmw42 Mar 29 '20 at 23:53

1 Answers1

0

Hello and welcome to Stack Overflow! It's nice to share some part of code so we can see what you are trying and help you better.

But anyways, reading your question and seeing the image examples (2 same size, 1 possible resized image) my first approach might be checking the shape of images with numpy.shape and then try to do some math and find the proportion for resize with cv2.resize, see this link for help.

My second idea if the first can't fully resolve the problem, you could look for the rectangle shapes with cv2.findContours to discover where the frames are and try again resize them for the new scale, see this other link.