Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 55
Registered: ‎09-09-2013
My Device: Dev Alpha C
My Carrier: Etisalat
Accepted Solution

How to get the camera view angles (horizontal and vertical)?

How to get the camera view angles (horizontal and vertical) ?

Be like Dan Brown, get the dimensions of every place you visit!
MeasureMe on App World
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to get the camera view angles (horizontal and vertical)?

What do you mean by angles?

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 55
Registered: ‎09-09-2013
My Device: Dev Alpha C
My Carrier: Etisalat

Re: How to get the camera view angles (horizontal and vertical)?

the field of view (in degrees). This should be a property for any Camera hardware.
Be like Dan Brown, get the dimensions of every place you visit!
MeasureMe on App World
Developer
Posts: 55
Registered: ‎09-09-2013
My Device: Dev Alpha C
My Carrier: Etisalat

Re: How to get the camera view angles (horizontal and vertical)?

something like this http://doc.qt.digia.com/qt-quick3d-snapshot/qml-camera.html#fieldOfView-prop
also i have ported an android app before to blackberry .. and i was using these lines of code to get these parameters:
camHorAngle = mCamera.getParameters().getHorizontalViewAngle();
camVerAngle = mCamera.getParameters().getVerticalViewAngle();
Be like Dan Brown, get the dimensions of every place you visit!
MeasureMe on App World
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to get the camera view angles (horizontal and vertical)?

AFAIK this is not available, you could do it manually but this is probably not what you want to do and you probably don't have all the devices.

 

I would recommend putting a JIRA report in and also trying to contact BlackBerry.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to get the camera view angles (horizontal and vertical)?

[ Edited ]

I understood even on Android this was not a reliable function with some values being hardcoded and/or random on some devices.

 


msalamali wrote:
something like this http://doc.qt.digia.com/qt-quick3d-snapshot/qml-camera.html#fieldOfView-prop
also i have ported an android app before to blackberry .. and i was using these lines of code to get these parameters:
camHorAngle = mCamera.getParameters().getHorizontalViewAngle();
camVerAngle = mCamera.getParameters().getVerticalViewAngle();

Ideally you would think everything accessible to Android would also be in the Native APIs but sadly that is not the case.

Put a request in to JIRA.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Highlighted
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: How to get the camera view angles (horizontal and vertical)?

The horizontal and vertical FOV properties are available with the camera_get_physical_property() function.

 

That's using the C Camera API. I don't believe you can access it using the Cascades Camera control.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 55
Registered: ‎09-09-2013
My Device: Dev Alpha C
My Carrier: Etisalat

Re: How to get the camera view angles (horizontal and vertical)?

[ Edited ]

i wrote the following code to use this function:

camera_handle_t hCamera;
camera_open(CAMERA_UNIT_REAR, CAMERA_MODE_PREAD , &hCamera);
camera_get_physical_property(hCamera, CAMERA_PHYSPROP_HORIZONTALFOV, &horizFov, CAMERA_PHYSPROP_VERTICALFOV, &verticalFov);
camera_close(hCamera);

but got the following errors:

make: *** [Device-Debug] Error 2
make[1]: *** [debug] Error 2

i have included the camera/camera_api.h file

Be like Dan Brown, get the dimensions of every place you visit!
MeasureMe on App World
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: How to get the camera view angles (horizontal and vertical)?

To use the C Camera API you need to include the library in your .pro file:

 

LIBS += -lcamapi -lscreen

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker