Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Input image already converted to a matrix
- Imgproc.cvtColor(matrixImage, matrixImage, Imgproc.COLOR_BGR2GRAY);
- // Gaussian blur
- Imgproc.GaussianBlur(matrixImage, matrixImage, new Size(7,7), 0);
- Imgproc.threshold(matrixImage, matrixImage, 125, 255, Imgproc.THRESH_BINARY_INV);
- // This is my current approach for removing noise. However, there is still
- // a lot of random areas that can be removed.
- // Remove specs from image
- Mat morphingMatrix = Mat.ones(3,3, CV_8UC1);
- Imgproc.morphologyEx(matrixImage, matrixImage, Imgproc.MORPH_OPEN, morphingMatrix);
- // Image denoising
- Photo.fastNlMeansDenoising(matrixImage, matrixImage);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement