Log in or register to post comments

Overlay Orientation Off

April 2, 2013 - 1:11pm #1

I'm creating an overlay application similar to the Cloudreco application which provides an overlay once an image is recognized.  The application scans the image and inserts and overlay.  My problem is that the overlay is off by 90 degrees and that it is about 3 times the size of the image that is scanned so it overlaps the edges of the screen.  Let me know if you have any suggestions to correct this problem?

Thanks!

Overlay Orientation Off

April 5, 2013 - 10:49am #10

The same problem is present in both portrait and landscape.  Separately, I noticed that when I upload portrait style images to the TargetManager, they show up in landscape after I upload them.

Thanks!

Overlay Orientation Off

April 5, 2013 - 10:16am #9

Are you able to try this with a fixed orientation at all e.g. Portrait or Landscape ?

This might help to determine whether the in-built rotation handling code is affecting it or if the problem is at the OpenGL ES level.

N

Overlay Orientation Off

April 4, 2013 - 2:16pm #8

Some more feedback on what I'm seeing.  In the sample CloudReco app, the layer is shown and then there is a seamless transition to the subview as an overlay.  In my app, the layer appears at 90 degrees to the image scanned and does not dissapear until I point the camera away from the image.  At that point, the subview appears on top of the image and registers to it perfectly.  

Let me know if you have any additional suggestions for debugging?

Thanks,

Jack

Overlay Orientation Off

April 4, 2013 - 6:48am #7

I could, but I'm wondering what would trigger the orientation of the overlay view to be off by 90 degrees (ie:landscape vs portrait) and what controls the size of the overlay in that it is probably 3x the image size when it is first shown.  Any suggestions would be greatly appreciated?

Overlay Orientation Off

April 3, 2013 - 3:19pm #6

It's not immediately obvious why you are seeing this problem if the code is more or less identical to the sample.

The only difference is that I am sourcing the image locally and retreiving the JSON file from the file included on your server with my cloud database image.

If you revert these changes, does the problem go away?

 

N

 

Overlay Orientation Off

April 3, 2013 - 11:45am #5

Attached are links to the original oversized image offset by 90 degrees (the layer) and the image (subview) that follows once the camera is moved away from the scanned image.

 

 

https://s3.amazonaws.com/miscmgb/image.png
https://s3.amazonaws.com/miscmgb/image2.png
 

Thanks!

Overlay Orientation Off

April 3, 2013 - 9:20am #4

Sure and thanks for your help.

I am simply creating my own overlay in place of the Books overlay by replacing the targetOverlayView.xib and TargetOverlayView.h & m files with my own.  

Then, I have modified the EAGLView to call these resources instead of those for the book.  The only difference is that I am sourcing the image locally and retreiving the JSON file from the file included on your server with my cloud database image.

 

The code in the CROverlayViewController's targetFound method has also changed to reflect the above:

 

McGarryBowenImage *aMGBimage = [notification object];

        [self.targetOverlayViewMGB createMGBImage:aMGBimage];

        [CRQCARutils getInstance].lastScannedMGBimage = aMGBimage;

        

        [self.arViewController setOverlayLayer:self.targetOverlayViewMGB.layer];

        

        [self.view addSubview:self.targetOverlayViewMGB];

        [self.targetOverlayViewMGB setHidden:YES];

        

        [self centerViewInFrame];

        

        loadingView.hidden = YES;

        

        //  Show close button

        closeButton.hidden = NO;

 

Again, the layer overlay is rotated at 90 degrees to the image and more than fills the iphone's screen.  When I move the camera away from the image the subview appears at the correct orientation.  I will try to send images separately.

Thanks!

Overlay Orientation Off

April 3, 2013 - 8:56am #3

Can you provide some more detail on this?

i.e. are you trying to add the layer via OpenGL?

N

Overlay Orientation Off

April 2, 2013 - 1:36pm #2

Note that this behavior only occurs for the overlay layer.  It does not occur when the image is added as a subview.

 

Log in or register to post comments