how to increase image sharpness with out losing it's colors by using android opencv
I am increasing image sharpness by using fallowing code
Mat source = Imgcodecs.imread(path, Imgcodecs.CV_LOAD_IMAGE_COLOR);
Mat destination=newMat(source.rows(),source.cols(),source.type());
Imgproc.GaussianBlur(source, destination, new Size(0,0), 10);
Core.addWeighted(source, 2.5, destination, -0.5, 0, destination);
bitmap = Bitmap.createBitmap(destination.cols(),
destination.rows(),Bitmap.Config.ARGB_8888);
Utils.matToBitmap(destination, bitmap);
image_view2.setImageBitmap(bm);
it is displaying some quality image but displayed image is only black & white, lost it's original colors
but I need to display the original colour
How to do it? Thank's for helping
Hmm you are reading an image as color, which is a 3 channel 8 bit image. Then you are pushing that data to a bitmap that uses 4 bytes according to the documentation. To me that seems the exact reason of your problem...
Also, your mat is defined as rows cols type, while your bitmap is cols rows type ... isnt that wrong?
Thank for response.i am beginer to the opencv,what is the right way for doing this(i have just image path,i need to increase sharpness with out losing it's colors).Thanks.....
I do not have experience with android/java programming myself, so will need to wait on someone who does!
Convert it to HSV color space and then increase the luminance value of each pixel. That's just my two cents.