edit the camera_para dat files?

Community support forum for the ARToolKit Professional v4.x for iOS SDK.

Moderator: ARToolKit developers

Forum rules
Ensure that any material you post to this forum complies with Apple's iOS SDK License terms.

edit the camera_para dat files?

Postby josef » Tue May 24, 2011 6:11 am

i ran into a problem the other day.

i want to take screenshots of my app and so i implemented a screenshot function. it works fine in theory but the problem is that the picture resolution is 480*320 only - even if the iphone 4 is equipped for higher resolutions.

i did some research and i found the following in my logs:

[ARViewController start] content 480x360 (wxh) will display in GL context 320x480 rotated.

in the code i found out that the camera settings are read from the camera_para-iPhone3.dat file. i expect the resolution to be set there cause i did not find another code piece that works with the resolution.

my question is: how can i get more pixel resolution in my app? can i somehow edit the dat file? can i set the resolution of the camera window somewhere else?

thanks in advance for your help!
josef
 
Posts: 21
Joined: Wed Sep 22, 2010 5:48 am

Re: edit the camera_para dat files?

Postby philip_lamb » Tue May 24, 2011 7:21 am

Since ARToolKit 4.5.1 for iOS, you can choose the camera resolution by supplying parameters to the arVideoOpen() call. The camera parameters file only holds the calibration information and doesn't change anything to do with the camera settings.

See this page for more information on the video config string options. http://www.artoolworks.com/support/libr ... ICE_IPHONE

However, I must note for you that the default on iPhone 4 is not to actually create a high-resolution OpenGL context. You'll need to make that change also (in EAGLView and ARView).
User avatar
philip_lamb
Site Admin
 
Posts: 506
Joined: Thu Mar 09, 2006 8:35 pm

Re: edit the camera_para dat files?

Postby kohdesmond » Thu Jun 09, 2011 8:57 am

Hi philip,

can you explain more on setting the camera parameter ?

i set my camera parameters
char *cparam_name = "/Data2/i4_720_inf.dat";

if (!cparam_name) cparam_name = "/Data2/i4_720_inf.dat";
ARParam wparam;
chdir("Data2");
int ret = arParamLoad(cparam_name, 1, &wparam);
.....

however the application still load the default camera parameter

Debug: Working directory is /var/mobile/Applications/21FCE317-60F3-4E9A-B21B-9E77334B0BA3/ARTesting.app
Using default video config.
*** Camera Parameter resized from 640, 480. ***
*** Camera Parameter ***
--------------------------------------
SIZE = 480, 360
Distortion factor: k1=0.1148608625, k2=-0.3868343532, p1=-0.0011599117, p2=0.0008288335
fx=467.422852, fy=465.276733, x0=239.924515, y0=176.189285, s=0.990288
472.00696 0.00000 239.92451 0.00000
0.00000 469.83978 176.18929 0.00000
0.00000 0.00000 1.00000 0.00000
--------------------------------------
2011-06-10 02:42:54.644 ARTesting[6395:707] [ARViewController start] content 480x360 (wxh) will display in GL context 320x480 rotated.
ARGL: set pixel format AR_PIXEL_FORMAT_BGRA.


did i missed out anything ?
kohdesmond
 
Posts: 24
Joined: Thu Apr 28, 2011 10:09 pm

Re: edit the camera_para dat files?

Postby philip_lamb » Thu Jun 09, 2011 9:27 am

Loading a different camera parameters file does NOT change the camera resolution... the camera parameters file contains ONLY the lens model, and in fact, this information is rescaled to match the actual camera resolution.

If you want to change to 640x480 camera frames on the phone, you'll need to edit "vconf" (right at the top of the -"start" method in ARViewController.m.) and choose the appropriate preset, e.g.:
Code: Select all
char *vconf = "-preset=480p";
User avatar
philip_lamb
Site Admin
 
Posts: 506
Joined: Thu Mar 09, 2006 8:35 pm

Re: edit the camera_para dat files?

Postby kohdesmond » Thu Jun 09, 2011 9:45 am

i see, thanks Phillip will try it out
kohdesmond
 
Posts: 24
Joined: Thu Apr 28, 2011 10:09 pm

Re: edit the camera_para dat files?

Postby josef » Tue Jun 14, 2011 4:50 am

i only found the char *vconf = "-width=1280 -height=1920"; option so far. what exactly do i need to change in the eaglview and in arview?
josef
 
Posts: 21
Joined: Wed Sep 22, 2010 5:48 am


Return to ARToolKit for iOS

Who is online

Users browsing this forum: No registered users and 0 guests

cron