OpenCV Java API で Gabor Filter
OpenCV 3.0 Java API で Gabor Filter を動かしてみました。 以下サンプルソースの下に説明を書きます。 import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.core.Size; import org.opencv.highgui.Highgui; import org.opencv.imgproc.Imgproc; // // Applying the Gabor filter to the input image. // class GaborFilter { double height = 10; double width = 10; double sigma = 1.4; double thetaDeg = 135; double lambda = 4; double gamma = 1.0; double psiDeg = 0; int ktype; public void apply() { System.out.println("Applying the Gabor filter"); Size ksize = new Size(height, width); // Reading an image Mat image = Highgui.imread( "lena.png" ); double theta = thetaDeg*Math.PI/180; // radian double psi = psiDeg*Math.PI/180; // radian // Making the source black and white. Mat mat1 = new Mat(image.rows(), image.cols(), CvType.CV_8UC1); Imgproc...