Ask Your Question
0

Android opencv-2.4.4: how do I select the front camera? [closed]

asked 2013-03-15 06:59:44 -0600

Barry Thomas gravatar image

updated 2013-03-15 07:11:05 -0600

Hi

I can't find any good reference on how to change the 2.4.4 tutorials to work with the front facing camera. Can someone point me in the right direction please?

With this in the manifest:

<uses-feature android:name="android.hardware.camera.front" android:required="true"/>

And this in onCreate:

mOpenCvCameraView.selectCamera(1);

Which calls in OpenCVDemo2View:

public void selectCamera (int i) {
    mOpenCvCameraView.releaseCamera();
    mCamera.open(i);
    }

... I get images from the default camera - same if I don't try to select a camera. But if I use selectCamera(0) I get a message saying, "It seems that you [sic] device does not support camera (or it is locked). Application will be closed."

Any pointers to good info on this would be welcomed.

Many thanks

Barry

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Adi
close date 2013-03-21 06:44:33.566879

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-03-15 14:45:05 -0600

I guess someone besides the actual creator of this post did not like my first reply. But since the actual accepted answer could help out others, here is the link again containing the solution.

http://answers.opencv.org/question/693/is-it-possible-to-use-front-camera-with-242-for/

edit flag offensive delete link more

Comments

1

Putting my answer as an alternative to the answer on the link provided by Steven.

Barry Thomas gravatar imageBarry Thomas ( 2013-03-16 04:57:34 -0600 )edit

I have removed your original post because it contained language not agreed in this forum. Please check the FAQ for what is allowed or not allowed here. While the answer was pertinent, we do not tolerate anything but politeness and courtesy. For questions that are asked again and again, there is a "Mark as duplicate" tool. For low-quality questions, there is the down-vote button, etc

sammy gravatar imagesammy ( 2013-03-18 02:09:38 -0600 )edit

Ok noted. I kinda did know why it was removed, as mentioned just beneath the topic, in talkin with Barry I already appoligized. Could have placed just a simple edit on my post, removing two lines, but didn't get the chance.

So basically I know what should and should not be posted, it was just the frustration of the moment :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-18 08:20:27 -0600 )edit
1

I know this frustration - sometimes I just want to delete a lot of garbage here, but we all have to abide to the rules. Btw, I deleted your post because if I only put a note, it's hard to get back and monitor the changes. The rule here is to delete what's bad: http://answers.opencv.org/question/1038/how-to-handle-inappropriate-editing-habits/

sammy gravatar imagesammy ( 2013-03-18 10:37:05 -0600 )edit

Btw, the actual Mark as duplicate, where can I find that?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-18 10:52:14 -0600 )edit

Hmmm, I am not sure is avaliable for all. It seems to be a moderator tool.

sammy gravatar imagesammy ( 2013-03-18 11:30:23 -0600 )edit

Question Tools

Stats

Asked: 2013-03-15 06:59:44 -0600

Seen: 3,413 times

Last updated: Mar 15 '13