Ask Your Question

How to use camera flash in NativeCameraView android

asked 2013-08-13 04:37:06 -0500

ajevajev gravatar image

updated 2013-08-13 05:33:34 -0500

I have to turn on camera flash using openCV. I need to use NativeCameraView but it doesn't work.

What can I do?

I tried :

VideoCapture mCamera;
edit retag flag offensive close merge delete


Please, in the future, try to focus on using tags without the hashtags. These hashtags create tons of double tags, which is not interesting if you want to apply filtering on topics. I have removed them and formatted your code a bit more correctly.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-13 04:46:54 -0500 )edit

thank you

ajevajev gravatar imageajevajev ( 2013-08-13 04:47:59 -0500 )edit

Maybe try


I dont know if its just a typo, but you try to set the focus, not flash mode

Moster gravatar imageMoster ( 2013-08-13 04:54:17 -0500 )edit

i tried flash_mote too

ajevajev gravatar imageajevajev ( 2013-08-13 05:04:37 -0500 )edit

What are you actually trying to do? Do you want to use it like a flashlight or as a real flash?

Moster gravatar imageMoster ( 2013-08-13 06:03:39 -0500 )edit

as a real flash

ajevajev gravatar imageajevajev ( 2013-08-13 06:05:23 -0500 )edit

I think the problem is that VideoCapture actually has no real photo functionality. Its just a camera/video stream and you have the possibility to retrieve a frame from it, but you actually dont take a real picture. So the flash wont work. At least this is how I imagine it.

Moster gravatar imageMoster ( 2013-08-13 06:18:53 -0500 )edit

In my app I do videos. I have to keep the flash on during the recording of the video.

ajevajev gravatar imageajevajev ( 2013-08-13 06:24:40 -0500 )edit


this worked for me

Moster gravatar imageMoster ( 2013-08-13 06:36:04 -0500 )edit

it works. thank you

ajevajev gravatar imageajevajev ( 2013-08-13 06:50:13 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-08-13 07:21:37 -0500

Moster gravatar image

updated 2013-08-13 07:42:52 -0500

The solution is to use FLASH_MODE_TORCH and not FLASH_MODE_ON


edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-08-13 04:37:06 -0500

Seen: 1,596 times

Last updated: Aug 13 '13