Log in or register to post comments

Image target deformation

June 27, 2014 - 8:02am #1
Hi,
I use the Vuforia plugin to scan a shape hand-colored in order to integrate it into my game 
I can get the camera image as a texture, but I would be able to crop it and make it flat.
Then I would like to apply a mask on it to have only the shape content without the outter part.
 
I found this topic about it, but I can not get the result I need :
 
Thanks by advance for your reply, and sorry for my English.

Image target deformation

September 4, 2014 - 8:42am #5

Hi, 

I'm still stuck with that.

I am trying to apply a mask on the perspective corrected texture, to extract the image target from the camera image.

But my image target is not centered inside the perspective corrected texture, so there are some shifts with the mask.

I want to extract the image target perfectly, with no shifts.

I tried to correct the shifts with the values of the camera orientation, but it is not perfect and they are still there.

Image target deformation

July 7, 2014 - 9:01am #4

Attach it as a child of the imageTarget and set its localPosition to Vector3.zero; (maybe need to adjust the y value slightly so that it appears on top, if you so wish) and localRotation to Quaternion.identity;

Image target deformation

July 7, 2014 - 7:54am #3

Thanks for your reply.

I have finaly managed to correct the perspective with this method.

But I don't understand how I can center the plane with the perspective corrected texture relative to the image target.

Image target deformation

July 1, 2014 - 5:16am #2

Hi,

the thread your are referring to:

https://developer.vuforia.com/forum/unity-3-extension-technical-discussion/image-deformation

explains how this can be done. 

However, the issue you might be facing is that the Camera image Aspect Ratio is usually not matching the screen Aspect Ratio (i.e. the width/height ratio); a sa consequence, in order to avoid camera image stretching, the image is rescaled so to fill the screen entirely, and a part of the camera image is thus falling outside of the screen boundaries.

The exact maths details are illustrated in the sample code implementation in the VideoTextureBehaviour.cs script that you can find in the BackgroundTextureAccess sample; I'd suggest to have a look there to know how to compute the correct scaling for your texture UV coordinates.

 

Log in or register to post comments