I am using below code to adjust image brightness using OpenCv but the Image gets all white or all black. here is my code used in a seek bar progress change. if I slide seek bar to 50 the image get brighter 50 percent. when I slide back to 0 the brighter Image is processed not original given.
function
//BRIGHTNESS
public Bitmap Brightness(Bitmap bitmap, double value){
Mat src = new Mat(bitmap.getHeight(),bitmap.getWidth(), CvType.CV_8UC1);
Utils.bitmapToMat(bitmap,src);
src.convertTo(src,-1,1,value);
Bitmap result = Bitmap.createBitmap(src.cols(),src.rows(), Bitmap.Config.ARGB_8888);
Utils.matToBitmap(src,result);
return result;
}