You can force the application, take photo with flash and other without flash

3

I am developing an application which uses the camera to detect diseases or problems in the gums, use opencv for the detection process, the problem is to capture 2 different photos, that is, one with flash and another without flash and so that no it is problematic for the common user

    
asked by Orvic Yampool Flores Principe 03.09.2016 в 02:19
source

1 answer

2

To take the photo with flash, use the method setFlashMode () (works from API 5) with FLASH_MODE_ON :

Parameters parameters = mCamera.getParameters();
parameters.setFlashMode(Parameters.FLASH_MODE_ON);

After taking the first photo with flash, use the same method but now with FLASH_MODE_OFF to take the photo without a flash:

parameters.setFlashMode(Parameters.FLASH_MODE_OFF);

I suggest you first validate if your camera supports the flash:

    if (parameters.getFlashMode()==null) {
       //No se tiene flash
    } else {
    //se tiene flash
   }
    
answered by 03.09.2016 в 02:51