예제 #1
0
        public static void Mat_to_vector_vector_Point(Mat m, List <MatOfPoint> pts)
        {
            if (m != null)
            {
                m.ThrowIfDisposed();
            }

            if (pts == null)
            {
                throw new CvException("Output List can't be null");
            }

            if (m == null)
            {
                throw new CvException("Input Mat can't be null");
            }

            List <Mat> mats = new List <Mat> (m.rows());

            Mat_to_vector_Mat(m, mats);
            foreach (Mat mi in mats)
            {
                MatOfPoint pt = new MatOfPoint(mi);
                pts.Add(pt);
                mi.release();
            }
            mats.Clear();
        }
예제 #2
0
        //
        // C++:  void detect(Mat img, vector_Point& foundLocations, vector_double& weights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), vector_Point searchLocations = std::vector<Point>())
        //

        //javadoc: HOGDescriptor::detect(img, foundLocations, weights, hitThreshold, winStride, padding, searchLocations)
        public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride, Size padding, MatOfPoint searchLocations)
        {
            ThrowIfDisposed();
            if (img != null)
            {
                img.ThrowIfDisposed();
            }
            if (foundLocations != null)
            {
                foundLocations.ThrowIfDisposed();
            }
            if (weights != null)
            {
                weights.ThrowIfDisposed();
            }
            if (searchLocations != null)
            {
                searchLocations.ThrowIfDisposed();
            }
#if UNITY_PRO_LICENSE || ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
            Mat foundLocations_mat  = foundLocations;
            Mat weights_mat         = weights;
            Mat searchLocations_mat = searchLocations;
            objdetect_HOGDescriptor_detect_10(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, searchLocations_mat.nativeObj);

            return;
#else
            return;
#endif
        }
예제 #3
0
        //javadoc: HOGDescriptor::detect(img, foundLocations, weights)
        public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights)
        {
            ThrowIfDisposed();
            if (img != null)
            {
                img.ThrowIfDisposed();
            }
            if (foundLocations != null)
            {
                foundLocations.ThrowIfDisposed();
            }
            if (weights != null)
            {
                weights.ThrowIfDisposed();
            }
#if UNITY_PRO_LICENSE || ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
            Mat foundLocations_mat = foundLocations;
            Mat weights_mat        = weights;
            objdetect_HOGDescriptor_detect_11(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj);

            return;
#else
            return;
#endif
        }
예제 #4
0
        //
        // C++:  void compute(Mat img, vector_float& descriptors, Size winStride = Size(), Size padding = Size(), vector_Point locations = std::vector<Point>())
        //

        //javadoc: HOGDescriptor::compute(img, descriptors, winStride, padding, locations)
        public void compute(Mat img, MatOfFloat descriptors, Size winStride, Size padding, MatOfPoint locations)
        {
            ThrowIfDisposed();
            if (img != null)
            {
                img.ThrowIfDisposed();
            }
            if (descriptors != null)
            {
                descriptors.ThrowIfDisposed();
            }
            if (locations != null)
            {
                locations.ThrowIfDisposed();
            }
#if UNITY_PRO_LICENSE || ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
            Mat descriptors_mat = descriptors;
            Mat locations_mat   = locations;
            objdetect_HOGDescriptor_compute_10(nativeObj, img.nativeObj, descriptors_mat.nativeObj, winStride.width, winStride.height, padding.width, padding.height, locations_mat.nativeObj);

            return;
#else
            return;
#endif
        }