First time here? Check out the FAQ!

Ask Your Question
0

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

asked Mar 15 '13

Barry Thomas gravatar image

updated Mar 15 '13

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

Preview: (hide)

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 Mar 15 '13

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/

Preview: (hide)

Comments

1

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

Barry Thomas gravatar imageBarry Thomas (Mar 16 '13)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 (Mar 18 '13)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 (Mar 18 '13)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 (Mar 18 '13)edit

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

StevenPuttemans gravatar imageStevenPuttemans (Mar 18 '13)edit

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

sammy gravatar imagesammy (Mar 18 '13)edit

Question Tools

Stats

Asked: Mar 15 '13

Seen: 3,427 times

Last updated: Mar 15 '13