Split highgui module to videoio and highgui

This commit is contained in:
vbystricky
2014-07-10 18:27:32 +04:00
committed by VBystricky
parent f773cd9a3e
commit d58f736935
149 changed files with 1673 additions and 1309 deletions

View File

@@ -4,7 +4,7 @@ import org.opencv.core.MatOfRect;
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.highgui.Highgui;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.objdetect.CascadeClassifier;
/*
@@ -19,7 +19,7 @@ public class DetectFaceDemo {
// directory.
CascadeClassifier faceDetector = new CascadeClassifier(getClass()
.getResource("/lbpcascade_frontalface.xml").getPath());
Mat image = Highgui.imread(getClass().getResource(
Mat image = Imgcodecs.imread(getClass().getResource(
"/AverageMaleFace.jpg").getPath());
// Detect faces in the image.
@@ -39,6 +39,6 @@ public class DetectFaceDemo {
// Save the visualized detection.
String filename = "faceDetection.png";
System.out.println(String.format("Writing %s", filename));
Highgui.imwrite(filename, image);
Imgcodecs.imwrite(filename, image);
}
}

View File

@@ -1,4 +1,4 @@
import org.opencv.highgui.Highgui
import org.opencv.imgcodecs.Imgcodecs
import org.opencv.features2d.DescriptorExtractor
import org.opencv.features2d.Features2d
import org.opencv.core.MatOfKeyPoint
@@ -45,8 +45,8 @@ object ScalaCorrespondenceMatchingDemo {
}
// Load the images from the |resources| directory.
val leftImage = Highgui.imread(getClass.getResource("/img1.png").getPath)
val rightImage = Highgui.imread(getClass.getResource("/img2.png").getPath)
val leftImage = Imgcodecs.imread(getClass.getResource("/img1.png").getPath)
val rightImage = Imgcodecs.imread(getClass.getResource("/img2.png").getPath)
// Detect KeyPoints and extract descriptors.
val (leftKeyPoints, leftDescriptors) = detectAndExtract(leftImage)
@@ -64,6 +64,6 @@ object ScalaCorrespondenceMatchingDemo {
Features2d.drawMatches(leftImage, leftKeyPoints, rightImage, rightKeyPoints, dmatches, correspondenceImage)
val filename = "scalaCorrespondences.png"
println(s"Writing ${filename}")
assert(Highgui.imwrite(filename, correspondenceImage))
assert(Imgcodecs.imwrite(filename, correspondenceImage))
}
}

View File

@@ -2,7 +2,7 @@ import org.opencv.core.Core
import org.opencv.core.MatOfRect
import org.opencv.core.Point
import org.opencv.core.Scalar
import org.opencv.highgui.Highgui
import org.opencv.imgcodecs.Imgcodecs
import org.opencv.objdetect.CascadeClassifier
import reflect._
@@ -16,7 +16,7 @@ object ScalaDetectFaceDemo {
// Create a face detector from the cascade file in the resources directory.
val faceDetector = new CascadeClassifier(getClass.getResource("/lbpcascade_frontalface.xml").getPath)
val image = Highgui.imread(getClass.getResource("/AverageMaleFace.jpg").getPath)
val image = Imgcodecs.imread(getClass.getResource("/AverageMaleFace.jpg").getPath)
// Detect faces in the image.
// MatOfRect is a special container class for Rect.
@@ -38,6 +38,6 @@ object ScalaDetectFaceDemo {
// Save the visualized detection.
val filename = "scalaFaceDetection.png"
println(s"Writing ${filename}")
assert(Highgui.imwrite(filename, image))
assert(Imgcodecs.imwrite(filename, image))
}
}