本文整理匯總了Java中org.opencv.core.Mat.release方法的典型用法代碼示例。如果您正苦於以下問題:Java Mat.release方法的具體用法?Java Mat.release怎麽用?Java Mat.release使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.opencv.core.Mat
的用法示例。
在下文中一共展示了Mat.release方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Mat_to_vector_vector_Point
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static void Mat_to_vector_vector_Point(Mat m, List<MatOfPoint> pts) {
if (pts == null)
throw new java.lang.IllegalArgumentException("Output List can't be null");
if (m == null)
throw new java.lang.IllegalArgumentException("Input Mat can't be null");
List<Mat> mats = new ArrayList<Mat>(m.rows());
Mat_to_vector_Mat(m, mats);
for (Mat mi : mats) {
MatOfPoint pt = new MatOfPoint(mi);
pts.add(pt);
mi.release();
}
mats.clear();
}
示例2: Mat_to_vector_vector_Point3f
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static void Mat_to_vector_vector_Point3f(Mat m, List<MatOfPoint3f> pts) {
if (pts == null)
throw new java.lang.IllegalArgumentException("Output List can't be null");
if (m == null)
throw new java.lang.IllegalArgumentException("Input Mat can't be null");
List<Mat> mats = new ArrayList<Mat>(m.rows());
Mat_to_vector_Mat(m, mats);
for (Mat mi : mats) {
MatOfPoint3f pt = new MatOfPoint3f(mi);
pts.add(pt);
mi.release();
}
mats.clear();
}
示例3: loadResource
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static Mat loadResource(Context context, int resourceId, int flags) throws IOException
{
InputStream is = context.getResources().openRawResource(resourceId);
ByteArrayOutputStream os = new ByteArrayOutputStream(is.available());
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = is.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
}
is.close();
Mat encoded = new Mat(1, os.size(), CvType.CV_8U);
encoded.put(0, 0, os.toByteArray());
os.close();
Mat decoded = Imgcodecs.imdecode(encoded, flags);
encoded.release();
return decoded;
}
示例4: findContours
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static void findContours(Mat image, List<MatOfPoint> contours, Mat hierarchy, int mode, int method)
{
Mat contours_mat = new Mat();
findContours_1(image.nativeObj, contours_mat.nativeObj, hierarchy.nativeObj, mode, method);
Converters.Mat_to_vector_vector_Point(contours_mat, contours);
contours_mat.release();
return;
}
示例5: knnMatch
import org.opencv.core.Mat; //導入方法依賴的package包/類
public void knnMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k, Mat mask, boolean compactResult)
{
Mat matches_mat = new Mat();
knnMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, k, mask.nativeObj, compactResult);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
return;
}
示例6: detectRegions
import org.opencv.core.Mat; //導入方法依賴的package包/類
public void detectRegions(Mat image, List<MatOfPoint> msers, MatOfRect bboxes)
{
Mat msers_mat = new Mat();
Mat bboxes_mat = bboxes;
detectRegions_0(nativeObj, image.nativeObj, msers_mat.nativeObj, bboxes_mat.nativeObj);
Converters.Mat_to_vector_vector_Point(msers_mat, msers);
msers_mat.release();
return;
}
示例7: radiusMatch
import org.opencv.core.Mat; //導入方法依賴的package包/類
public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance, List<Mat> masks, boolean compactResult)
{
Mat matches_mat = new Mat();
Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
radiusMatch_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, masks_mat.nativeObj, compactResult);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
return;
}
示例8: calibrate
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static double calibrate(List<Mat> objectPoints, List<Mat> imagePoints, Size image_size, Mat K, Mat D, List<Mat> rvecs, List<Mat> tvecs, int flags)
{
Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints);
Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints);
Mat rvecs_mat = new Mat();
Mat tvecs_mat = new Mat();
double retVal = calibrate_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, image_size.width, image_size.height, K.nativeObj, D.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags);
Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
rvecs_mat.release();
Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
tvecs_mat.release();
return retVal;
}
示例9: detect
import org.opencv.core.Mat; //導入方法依賴的package包/類
public void detect(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> masks)
{
Mat images_mat = Converters.vector_Mat_to_Mat(images);
Mat keypoints_mat = new Mat();
Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
detect_2(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, masks_mat.nativeObj);
Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
keypoints_mat.release();
return;
}
示例10: calibrateCamera
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static double calibrateCamera(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags)
{
Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints);
Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints);
Mat rvecs_mat = new Mat();
Mat tvecs_mat = new Mat();
double retVal = calibrateCamera_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags);
Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
rvecs_mat.release();
Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
tvecs_mat.release();
return retVal;
}
示例11: radiusMatch
import org.opencv.core.Mat; //導入方法依賴的package包/類
public void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance, Mat mask, boolean compactResult)
{
Mat matches_mat = new Mat();
radiusMatch_0(nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj, maxDistance, mask.nativeObj, compactResult);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
return;
}
示例12: calibrateCameraExtended
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static double calibrateCameraExtended(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors)
{
Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints);
Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints);
Mat rvecs_mat = new Mat();
Mat tvecs_mat = new Mat();
double retVal = calibrateCameraExtended_2(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj);
Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
rvecs_mat.release();
Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
tvecs_mat.release();
return retVal;
}
示例13: calibrateCameraExtended
import org.opencv.core.Mat; //導入方法依賴的package包/類
public static double calibrateCameraExtended(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags)
{
Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints);
Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints);
Mat rvecs_mat = new Mat();
Mat tvecs_mat = new Mat();
double retVal = calibrateCameraExtended_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj, flags);
Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
rvecs_mat.release();
Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
tvecs_mat.release();
return retVal;
}
示例14: compute
import org.opencv.core.Mat; //導入方法依賴的package包/類
public void compute(List<Mat> images, List<MatOfKeyPoint> keypoints, List<Mat> descriptors)
{
Mat images_mat = Converters.vector_Mat_to_Mat(images);
List<Mat> keypoints_tmplm = new ArrayList<Mat>((keypoints != null) ? keypoints.size() : 0);
Mat keypoints_mat = Converters.vector_vector_KeyPoint_to_Mat(keypoints, keypoints_tmplm);
Mat descriptors_mat = new Mat();
compute_1(nativeObj, images_mat.nativeObj, keypoints_mat.nativeObj, descriptors_mat.nativeObj);
Converters.Mat_to_vector_vector_KeyPoint(keypoints_mat, keypoints);
keypoints_mat.release();
Converters.Mat_to_vector_Mat(descriptors_mat, descriptors);
descriptors_mat.release();
return;
}
示例15: radiusMatch
import org.opencv.core.Mat; //導入方法依賴的package包/類
public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance)
{
Mat matches_mat = new Mat();
radiusMatch_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
return;
}