'How to set color effect on document(image) using OpenCV(java)
currently, I'm working on a document scanner project who captures and filter document with different effects and color but I'm a beginner to work with OpenCV.
but, now I understand how medianBlurFilter , gaussianBlurFilter , cannyFilter and bilateralFilter works.
just I am starting to do this type of filter with the use of OpenCV but I can't understand how to achieve this.
Input :
How to achieve this?:
Solution 1:[1]
//bitmap is a normal document image
Bitmap newB = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(newB);
canvas.drawColor(Color.argb(sp,255, 0, 0));
Mat src = new Mat();
Utils.bitmapToMat(bitmap, src);
Mat dst = new Mat();
Utils.bitmapToMat(newB, dst);
Core.addWeighted(src, 1f, dst, 0.5f, 0.5, dst);
//bitmapNew is a filtered document image
Bitmap bitmapNew = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Utils.matToBitmap(dst, bitmapNew);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | EAS |



