Java Code Examples for org.opencv.core.Core.bitwise_not()

The following are Jave code examples for showing how to use bitwise_not() of the org.opencv.core.Core class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: kronometer   File: SketchRecognition.java   View Source Code Vote up 5 votes
private void setFilter() {
    //Apply gaussian blur to remove noise
    Imgproc.GaussianBlur(image, image, new Size(5, 5), 0);

    //Threshold
    Imgproc.adaptiveThreshold(image, image, 255, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C, Imgproc.THRESH_BINARY, 7, 1);
    
    //Invert the image
    Core.bitwise_not(image, image);

    //Dilate
    Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_DILATE, new Size(3, 3), new Point(1, 1));
    Imgproc.dilate(image, image, kernel);
}
 
Example 2
Project: SudoCAM-Ku   File: Thresholding.java   View Source Code Vote up 4 votes
public static Mat InvertImageColor(Mat img){
	Mat im = new Mat();;
	Core.bitwise_not(normalThresholding(img),im);
    Core.multiply(im,new Scalar(255),im);
	return im;
}