Log in or register to post comments

Camera Issue - Stretched

February 20, 2013 - 2:57am #1

Hello,

I am working on Vuforia SDK 2.0.6 for Android.

The Camera resolution is not good on GALAXY S3 and the view is stretched.

For example, I have tested the samples VideoPlayBack/Framemarker but the images scanned looked stretched on the Galaxy S3, The marker which is normally a squarre looked like a rectangle.

I digged out and I think the problem is the camera calibration.

 

[Camera Device Mode Setting is MODE_OPTIMIZE_QUALITY] and I got 800x480 on Landscape.

The problem is that the screen resolution of the Galasy s3  is 1280,720 on Landscape.

 

I have set the focus mode to FOCUS_MODE_TRIGGERAUTO but it does not fix the issue.

 

Has anybody encountered this issue ? 

Any help please,  

 

Thanks

 

Camera Issue - Stretched

February 25, 2013 - 11:55pm #15

That's great. You're welcome.

Camera Issue - Stretched

February 25, 2013 - 5:23pm #14

Hello,

I uninstalled the app, then installed it again.

Everything's fine. It is not streched anymore. 

Thanks for the feedback; it is really really appreciated.

 

Thanks again

 

 

Camera Issue - Stretched

February 24, 2013 - 1:51pm #13

Hi, the device profile for your device has been updated;

could you try again ?

please, when doing the test, make sure to first clear the cache (or even completely uninstall the app) and reinstall theapp again (this is of key importance), and make sure that you have internet connection enabled.

 

Camera Issue - Stretched

February 22, 2013 - 5:23pm #12

Hello,

Thanks for the input. I really hope to have a fix of this issue.

Thanks again.

 

Camera Issue - Stretched

February 22, 2013 - 6:03am #11

I will udpate you as soon as we have a fix for this.

Camera Issue - Stretched

February 22, 2013 - 5:12am #10

Hello,

Thank you for the input, it is appreciated.

Although this workaround does not work. 

In the startCamera method:

 

    if (!QCAR::CameraDevice::getInstance().selectVideoMode( QCAR::CameraDevice::MODE_OPTIMIZE_QUALITY))  return;
        
    // Configure the video background
    configureVideoBackground();
        
    // Start the camera:
    if (!QCAR::CameraDevice::getInstance().start())  return;
 
So configureVideoBackground() method is called before the camera get starting, and in the  configureVideoBackground()  we have for the workaround
QCAR::State state = QCAR::Renderer::getInstance().begin();                            
QCAR::Frame frame = state.getFrame();
const QCAR::Image *image = frame.getImage( 0 );
int videoWidth = image->getWidth();
int videoHeight = image->getHeight();
 
The problem is that these lines should be called after the camera is started, not before.  Doing it like result in a crash of the app.
 
Even if I set static values for videoWidth and videoHeight and use these values instead of videoMode.mWidth and videoMode.mHeight like you explain, the result is the same. It looks streched and the markers are rectangular not square.  
 
My guess is because we set the video CameraDevice::getInstance().selectVideoMode.  Removing that is not helping either as it results in a crash.
 
 
Thanks, I hope there is a fix for the issue.

Camera Issue - Stretched

February 22, 2013 - 1:44am #9

Hi, meanwhile, as a workaround, you could retrieve the actual width and height used by your camera via this code (and use these values in the configureVideoBackground() instead of the videoMode.mWidth and videoMode.mHeight which are incorrect):

QCAR::Frame frame = state.getFrame();
const QCAR::Image *image = frame.getImage( 0 );
int videoWidth = image->getWidth(); 
int videoHeight = image->getHeight();

 

 

Camera Issue - Stretched

February 22, 2013 - 1:37am #8

Hi, that's perfect. I will be in touch with you as soon as I get an update.

Camera Issue - Stretched

February 22, 2013 - 1:22am #7

Hello,

Thanks for your input, it is really appreciated.

Here are my device information. It is a Galaxy S3.

Model number : SGH-T999V

Android Version : 4.1.1

Baseband version : T999VVLDLL1

Build Number : JR003L.T999VVDLL1

 

I hope these information will help.

 

Thanks again.

 

 

 

Camera Issue - Stretched

February 22, 2013 - 12:00am #6

Hi, I compared the numbers (width and height) that you get with the ones I get (for the same MODE_OPTIMIZE_QUALITY) and I realized they are actually slightly different;

this means there is an issue with the Device Profile for your device; even if it is a Galaxy S3 like the one I tested on, the specific model is certainly different (i.e. not all S3 have the same hardware and software, there can be quite some differences); in our database we are aware of at least 5 or 6 different types of Galaxy S3.

So, to fix the issue, I would need from you the exact model number of your device and the Android version as well; you can get this information from the Settings -> About Device

 

 

 

Camera Issue - Stretched

February 21, 2013 - 10:09pm #5

Hello,

Thanks for your input , it is appreciated.

I have tested several times the FrameMarker sample app (v2.0.6) without any modification on my Galaxy S3 and it look stretched; it is very noticeable when you turn the phone in Portrait.

The markers look rectangular not square.  So there is certainly an issue somewhere. I don't think there are different types of Galaxy S3, so you should also have the same result on your Galaxy S3.

Anyway, I hope there is a fix for this. 

 

Thanks

 

 

 

 

Camera Issue - Stretched

February 21, 2013 - 6:07am #4

Hi, videoMode.mWidth and videoMode.mHeight represent the resolution of the Camera image (i.e. the video frames captured by the camera); this has no relationship with your device screen resolution, which can be much higher of course (e.g. 1280 x 720).

The purpose of the configureVideoBackground() function is exactly to make the necessary calculations so to compensate for those differences when the video background texture is displayed by QCAR.

 

 

 

Camera Issue - Stretched

February 20, 2013 - 4:49pm #3

Hello,

 

Thank you for you input. It is appreciated.

 

This is exactly what I am doing. I use MODE_OPTIMIZE_QUALITY in both places.

I setup my application to Landscape and the markers are not squares, they look rectangular. You can really see that when you turn the phone in Portrait.

Could you please tell me why ( videoMode.mWidth, videoMode.mHeight) returns (800,480) and not (1280,720) ? 1280x720 is the actual screen size.

Is it possible to have  ( videoMode.mWidth, videoMode.mHeight) returns (1280,720) or to set these values ?

 

Thanks again.

 

 

Camera Issue - Stretched

February 20, 2013 - 8:25am #2

Hi, all the samples contain a function called configureVideoBackground() (see native code in FrameMarkers.cpp for instance);

in such function, the videobackground image gets configured by taking into account the actual resolution of the camera (see variables videoMode.mWidth and videoMode.mHeight) and the resolution of the screen as well (for instance 1280 x 720 in your case, as you mention);

a set of calculations are done so to apply a proper size to the background (i.e. in practice the videobackground is configured in such a way so to eliminate any stretching artifcats due to the different resolutions of the screen versus the camera video feed);

if you are using MODE_OPTIMIZE_QUALITY however (instead of the DEFAULT), you should make sure that you use that mode both when you select the camera mode (i.e. in the startCamera() function) and when you retrieve the videoMode in the configureVideoBackground() function, i.e.:

 

if (!QCAR::CameraDevice::getInstance().selectVideoMode(
                                QCAR::CameraDevice::MODE_OPTIMIZE_QUALITY))
        return;

and here:

void
configureVideoBackground()
{
    // Get the default video mode:
    QCAR::CameraDevice& cameraDevice = QCAR::CameraDevice::getInstance();
    QCAR::VideoMode videoMode = cameraDevice.
                     getVideoMode(QCAR::CameraDevice::MODE_OPTIMIZE_QUALITY);

 

If you use different parameters in those two places, you might end up with inconsistencies and thus stretched images.

I hope this helps.

(Note: I just tested the samples Apps on my Galaxy S3 and did not observe the stretching)

 

Log in or register to post comments