/**
* Takes the base OpenCV list of contours and changes the output to be easier to
* work with.
*
* @param contours
* The input from the base OpenCV contours output
*/
private void createParticleReports (List<MatOfPoint> contours)
{
ParticleReport[] reports = new ParticleReport[contours.size()];
for (int i = 0; i < reports.length; i++)
{
reports[i] = new ParticleReport();
Rect r = Imgproc.boundingRect(contours.get(i));
reports[i].area = r.area();
reports[i].center = new Point(r.x + (r.width / 2),
r.y + (r.height / 2));
reports[i].boundingRect = r;
}
this.particleReports = reports;
}
java类org.opencv.core.MatOfPoint的实例源码
VisionProcessor.java 文件源码
项目:2017
阅读 20
收藏 0
点赞 0
评论 0
Converters.java 文件源码
项目:react-native-scan-doc
阅读 25
收藏 0
点赞 0
评论 0
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();
}
Converters.java 文件源码
项目:opencv-documentscanner-android
阅读 22
收藏 0
点赞 0
评论 0
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();
}
Converters.java 文件源码
项目:Image-Detection-Samples
阅读 26
收藏 0
点赞 0
评论 0
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();
}
Converters.java 文件源码
项目:mao-android
阅读 64
收藏 0
点赞 0
评论 0
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();
}
Converters.java 文件源码
项目:MOAAP
阅读 71
收藏 0
点赞 0
评论 0
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();
}
Converters.java 文件源码
项目:Android-Code-Demos
阅读 24
收藏 0
点赞 0
评论 0
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();
}
Imgproc.java 文件源码
项目:Microsphere
阅读 19
收藏 0
点赞 0
评论 0
public static void goodFeaturesToTrack(Mat image, MatOfPoint corners, int maxCorners, double qualityLevel, double minDistance, Mat mask, int blockSize, boolean useHarrisDetector, double k)
{
Mat corners_mat = corners;
goodFeaturesToTrack_0(image.nativeObj, corners_mat.nativeObj, maxCorners, qualityLevel, minDistance, mask.nativeObj, blockSize, useHarrisDetector, k);
return;
}
Imgproc.java 文件源码
项目:MOAAP
阅读 19
收藏 0
点赞 0
评论 0
public static void fillPoly(Mat img, List<MatOfPoint> pts, Scalar color)
{
List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0);
Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm);
fillPoly_1(img.nativeObj, pts_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3]);
return;
}
MSER.java 文件源码
项目:mao-android
阅读 20
收藏 0
点赞 0
评论 0
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;
}
Imgproc.java 文件源码
项目:Checkerboard-IMU-Comparator
阅读 25
收藏 0
点赞 0
评论 0
public static void drawContours(Mat image, List<MatOfPoint> contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset)
{
List<Mat> contours_tmplm = new ArrayList<Mat>((contours != null) ? contours.size() : 0);
Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm);
drawContours_0(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, hierarchy.nativeObj, maxLevel, offset.x, offset.y);
return;
}
Imgproc.java 文件源码
项目:DNNLibrary
阅读 18
收藏 0
点赞 0
评论 0
public static void polylines(Mat img, List<MatOfPoint> pts, boolean isClosed, Scalar color, int thickness)
{
List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0);
Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm);
polylines_1(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3], thickness);
return;
}
Imgproc.java 文件源码
项目:DogeCV
阅读 18
收藏 0
点赞 0
评论 0
public static void convexHull(MatOfPoint points, MatOfInt hull, boolean clockwise)
{
Mat points_mat = points;
Mat hull_mat = hull;
convexHull_0(points_mat.nativeObj, hull_mat.nativeObj, clockwise);
return;
}
Imgproc.java 文件源码
项目:DNNLibrary
阅读 20
收藏 0
点赞 0
评论 0
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;
}
Imgproc.java 文件源码
项目:mao-android
阅读 28
收藏 0
点赞 0
评论 0
public static boolean isContourConvex(MatOfPoint contour)
{
Mat contour_mat = contour;
boolean retVal = isContourConvex_0(contour_mat.nativeObj);
return retVal;
}
Imgproc.java 文件源码
项目:FaceDetectDemo
阅读 21
收藏 0
点赞 0
评论 0
public static void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, MatOfPoint pts)
{
Mat pts_mat = pts;
ellipse2Poly_0(center.x, center.y, axes.width, axes.height, angle, arcStart, arcEnd, delta, pts_mat.nativeObj);
return;
}
Imgproc.java 文件源码
项目:opencv-documentscanner-android
阅读 16
收藏 0
点赞 0
评论 0
public static void fillPoly(Mat img, List<MatOfPoint> pts, Scalar color)
{
List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0);
Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm);
fillPoly_1(img.nativeObj, pts_mat.nativeObj, color.val[0], color.val[1], color.val[2], color.val[3]);
return;
}
Imgproc.java 文件源码
项目:android-imaging-utils
阅读 24
收藏 0
点赞 0
评论 0
public static void polylines(Mat img, List<MatOfPoint> pts, boolean isClosed, Scalar color, int thickness)
{
List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0);
Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm);
polylines_1(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3], thickness);
return;
}
HOGDescriptor.java 文件源码
项目:RobotIGS
阅读 21
收藏 0
点赞 0
评论 0
public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights)
{
Mat foundLocations_mat = foundLocations;
Mat weights_mat = weights;
detect_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj);
return;
}
Imgproc.java 文件源码
项目:android-age-estimator
阅读 23
收藏 0
点赞 0
评论 0
public static void polylines(Mat img, List<MatOfPoint> pts, boolean isClosed, Scalar color)
{
List<Mat> pts_tmplm = new ArrayList<Mat>((pts != null) ? pts.size() : 0);
Mat pts_mat = Converters.vector_vector_Point_to_Mat(pts, pts_tmplm);
polylines_2(img.nativeObj, pts_mat.nativeObj, isClosed, color.val[0], color.val[1], color.val[2], color.val[3]);
return;
}
Imgproc.java 文件源码
项目:opencv-documentscanner-android
阅读 19
收藏 0
点赞 0
评论 0
public static void goodFeaturesToTrack(Mat image, MatOfPoint corners, int maxCorners, double qualityLevel, double minDistance)
{
Mat corners_mat = corners;
goodFeaturesToTrack_1(image.nativeObj, corners_mat.nativeObj, maxCorners, qualityLevel, minDistance);
return;
}
Imgproc.java 文件源码
项目:RobotIGS
阅读 19
收藏 0
点赞 0
评论 0
public static void convexHull(MatOfPoint points, MatOfInt hull)
{
Mat points_mat = points;
Mat hull_mat = hull;
convexHull_1(points_mat.nativeObj, hull_mat.nativeObj);
return;
}
Imgproc.java 文件源码
项目:Image-Detection-Samples
阅读 21
收藏 0
点赞 0
评论 0
public static void ellipse2Poly(Point center, Size axes, int angle, int arcStart, int arcEnd, int delta, MatOfPoint pts)
{
Mat pts_mat = pts;
ellipse2Poly_0(center.x, center.y, axes.width, axes.height, angle, arcStart, arcEnd, delta, pts_mat.nativeObj);
return;
}
Imgproc.java 文件源码
项目:Microsphere
阅读 20
收藏 0
点赞 0
评论 0
public static void findContours(Mat image, List<MatOfPoint> contours, Mat hierarchy, int mode, int method, Point offset)
{
Mat contours_mat = new Mat();
findContours_0(image.nativeObj, contours_mat.nativeObj, hierarchy.nativeObj, mode, method, offset.x, offset.y);
Converters.Mat_to_vector_vector_Point(contours_mat, contours);
contours_mat.release();
return;
}
Imgproc.java 文件源码
项目:renderscript_examples
阅读 19
收藏 0
点赞 0
评论 0
public static void drawContours(Mat image, List<MatOfPoint> contours, int contourIdx, Scalar color, int thickness)
{
List<Mat> contours_tmplm = new ArrayList<Mat>((contours != null) ? contours.size() : 0);
Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm);
drawContours_1(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3], thickness);
return;
}
HOGDescriptor.java 文件源码
项目:Ftc2018RelicRecovery
阅读 30
收藏 0
点赞 0
评论 0
public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights)
{
Mat foundLocations_mat = foundLocations;
Mat weights_mat = weights;
detect_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj);
return;
}
HOGDescriptor.java 文件源码
项目:android-things-drawbot
阅读 18
收藏 0
点赞 0
评论 0
public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights)
{
Mat foundLocations_mat = foundLocations;
Mat weights_mat = weights;
detect_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj);
return;
}
Imgproc.java 文件源码
项目:NotifyTools
阅读 21
收藏 0
点赞 0
评论 0
public static boolean isContourConvex(MatOfPoint contour)
{
Mat contour_mat = contour;
boolean retVal = isContourConvex_0(contour_mat.nativeObj);
return retVal;
}
Imgproc.java 文件源码
项目:react-native-scan-doc
阅读 26
收藏 0
点赞 0
评论 0
public static void drawContours(Mat image, List<MatOfPoint> contours, int contourIdx, Scalar color)
{
List<Mat> contours_tmplm = new ArrayList<Mat>((contours != null) ? contours.size() : 0);
Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm);
drawContours_2(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3]);
return;
}
Imgproc.java 文件源码
项目:NotifyTools
阅读 20
收藏 0
点赞 0
评论 0
public static void drawContours(Mat image, List<MatOfPoint> contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset)
{
List<Mat> contours_tmplm = new ArrayList<Mat>((contours != null) ? contours.size() : 0);
Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm);
drawContours_0(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, hierarchy.nativeObj, maxLevel, offset.x, offset.y);
return;
}