10

I am quite new to OpenCV and DIP in general so I need bit of help in stitching of two images. The problem background is, there are two pieces which have their adhesives/glue torn apart from two joined pieces of plastic. This is the image of "glue" on the base:

img1

and this is the image of "glue" on the other attached face:

img2

As the background of the the images is not the same, I read that it's not possible to do stitching (because different features). And these two pieces are like jigsaw pieces which needs to rotated, so the problem is not straightforward like panaroma stitching.

How do I join such images together?

I was thinking of finding the white color countours and then keeping one image fixed, rotating the other one and finding area of merged countours, also storing the angle of what I rotate. The area would become smallest when there would be perfect match.

Community
  • 1
  • 1
Pranav Arora
  • 186
  • 12
  • How many of these images need to be stitched together this way? Just one? – Kyle May 23 '19 at 02:58
  • This question might get better answers on [SE Signal Processing](https://dsp.stackexchange.com/questions/tagged/image-processing). – Kyle May 23 '19 at 02:58
  • No , multiple images , but follow a similar structure , like when you tear off the glue from two parts of plastic , you might get different patterns of adhesive on each side of the plastic , but have to be stitched in similar fashion. – Pranav Arora May 23 '19 at 03:02
  • 1
    If you know the entire area of glue will take up the majority of the screen, the strategy you mention in the last paragraph will probably work. – Kyle May 23 '19 at 03:11
  • [Discussed on meta](https://meta.stackoverflow.com/questions/386284/what-should-we-do-with-questions-relying-on-deleted-images?cb=1) – Patrick Artner Jun 21 '19 at 06:09

1 Answers1

5

This is not a complete answer, (no-one said answers have to be complete), but it may inspire you or someone else to work out a method.

I flipped vertically and flopped horizontally one of your images and then put them both into Photoshop on two separate layers. I then set the "Blending Mode" to Difference which is always a great way to align images - because they normally go black when images are aligned and there is no difference.

I then moved one layer around on the other. I guess you will need to do something similar to solve your problem - you just need to find something that your code can maximise or minimise.

enter image description here

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432