Inverse Mapping concept, mask a portion and get front full image

offonoll's picture

That is it! I am wondering if there is any post I haven't seen talking about getting a portion of an image and getting the front full image from it. It is right the inverse concept of the mapping, where you get the full video into a free transformed image. I am looking the inverse effect. Thank you in advance! O.

PreviewAttachmentSize
mask-crop-to-full.jpg
mask-crop-to-full.jpg50 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

gtoledo3's picture
Re: Inverse Mapping concept, mask a portion and get front ...

Do you mean taking a parallelogram and correcting it into a rectangle?

offonoll's picture
Re: Inverse Mapping concept, mask a portion and get front ...

That's correct. :)

gtoledo3's picture
Re: Inverse Mapping concept, mask a portion and get front ...

Well, I think it is the same approach as a quad warp then, and that which way the transform is happening (rect->arbitrary quad or arbitrary quad-> rect) the steps involved are pretty similar.

If you wish to do this with stock patches, you can use CI Perspective Transform. See attachment. I took your sample pic, cropped in tight to the monitor, and perspective transformed it back to a rectangle. (note how the warp on the boundary region looks pretty much like the inverse of the shape of your monitor.)

I know that franz of _1024 made a plugin that works in QC units (I think it works in units at least) and provides interactive control of points I believe. That is also a correct perspective transform. I think both approaches have their merits depending on context.

PreviewAttachmentSize
perspective transform example_gt.qtz53.86 KB

offonoll's picture
Re: Inverse Mapping concept, mask a portion and get front ...

Ok. With perspective transform is possible but I was thinking on creating a parallelogram mask in the source image using mouse and get a rectangle image from it. I am willing to create something similar as WII white board does to calibrate and track the position of an IR light from a rectangle image. http://www.uweschmidt.org/wiimote-whiteboard

franz's picture
Re: Inverse Mapping concept, mask a portion and get front ...

I have an inverse perspective plugin, that takes a quad in perspective and converts it back to a square. If that's what you're looking for, I'll try to polish it a bit and release it.

offonoll's picture
Re: Inverse Mapping concept, mask a portion and get front ...

Yes! I would love to see how it works! Thank's!

gtoledo3's picture
Re: Inverse Mapping concept, mask a portion and get front ...

Wow, that would be really handy to have things mapping to screenspace without muss or fuss for sure.

Does it convert to square, or just make lines parallel (eg., rectangle)?

franz's picture
Re: Inverse Mapping concept, mask a portion and get front ...

it converts to square. then you can remap it on a rectangle.

gtoledo3's picture
Re: Inverse Mapping concept, mask a portion and get front ...

Nice... I'm not trying to bug you, but does it a value for difference between each corner and square? The basic function that is being described has me thinking of the fact that an inferred rotation can possibly be derived for the skewed quad with some extra math, if it's easy to get the difference between uncorrected and corrected points. That would be awesome!

franz's picture
Re: Inverse Mapping concept, mask a portion and get front ...

added to 1024 blog

chiara's picture
Re: Inverse Mapping concept, mask a portion and get front ...

Hi there, I’ve seen all the examples made by George and wondering if someone (if possible) has masked a moving figure. I’m using the video input and I’d like to mask only the moving figures excluding the background, in this case the room behind. For ex. In After Effect, there is a tool to create animated mask from an animated sketched, don’t know if it’s possible also in q.c. Always thanks for your help, Chiara