コード例 #1
0
ファイル: TrainData.cs プロジェクト: Raniot/AR_Assignment3
        //javadoc: TrainData::create(samples, layout, responses, varIdx, sampleIdx)
        public static TrainData create(Mat samples, int layout, Mat responses, Mat varIdx, Mat sampleIdx)
        {
            if (samples != null)
            {
                samples.ThrowIfDisposed();
            }
            if (responses != null)
            {
                responses.ThrowIfDisposed();
            }
            if (varIdx != null)
            {
                varIdx.ThrowIfDisposed();
            }
            if (sampleIdx != null)
            {
                sampleIdx.ThrowIfDisposed();
            }
#if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
            TrainData retVal = TrainData.__fromPtr__(ml_TrainData_create_12(samples.nativeObj, layout, responses.nativeObj, varIdx.nativeObj, sampleIdx.nativeObj));

            return(retVal);
#else
            return(null);
#endif
        }
コード例 #2
0
ファイル: TrainData.cs プロジェクト: Bersaelor/FaceMaskUnity
        /**
         * Creates training data from in-memory arrays.
         *
         *     param samples matrix of samples. It should have CV_32F type.
         *     param layout see ml::SampleTypes.
         *     param responses matrix of responses. If the responses are scalar, they should be stored as a
         *         single row or as a single column. The matrix should have type CV_32F or CV_32S (in the
         *         former case the responses are considered as ordered by default; in the latter case - as
         *         categorical)
         *     param varIdx vector specifying which variables to use for training. It can be an integer vector
         *         (CV_32S) containing 0-based variable indices or byte vector (CV_8U) containing a mask of
         *         active variables.
         *     param sampleIdx vector specifying which samples to use for training. It can be an integer
         *         vector (CV_32S) containing 0-based sample indices or byte vector (CV_8U) containing a mask
         *         of training samples.
         *     param sampleWeights optional vector with weights for each sample. It should have CV_32F type.
         *         <number_of_variables_in_responses>`, containing types of each input and output variable. See
         *         ml::VariableTypes.
         * return automatically generated
         */
        public static TrainData create(Mat samples, int layout, Mat responses, Mat varIdx, Mat sampleIdx, Mat sampleWeights)
        {
            if (samples != null)
            {
                samples.ThrowIfDisposed();
            }
            if (responses != null)
            {
                responses.ThrowIfDisposed();
            }
            if (varIdx != null)
            {
                varIdx.ThrowIfDisposed();
            }
            if (sampleIdx != null)
            {
                sampleIdx.ThrowIfDisposed();
            }
            if (sampleWeights != null)
            {
                sampleWeights.ThrowIfDisposed();
            }

            return(TrainData.__fromPtr__(ml_TrainData_create_11(samples.nativeObj, layout, responses.nativeObj, varIdx.nativeObj, sampleIdx.nativeObj, sampleWeights.nativeObj)));
        }
コード例 #3
0
ファイル: TrainData.cs プロジェクト: Bersaelor/FaceMaskUnity
        /**
         * Creates training data from in-memory arrays.
         *
         *     param samples matrix of samples. It should have CV_32F type.
         *     param layout see ml::SampleTypes.
         *     param responses matrix of responses. If the responses are scalar, they should be stored as a
         *         single row or as a single column. The matrix should have type CV_32F or CV_32S (in the
         *         former case the responses are considered as ordered by default; in the latter case - as
         *         categorical)
         *         (CV_32S) containing 0-based variable indices or byte vector (CV_8U) containing a mask of
         *         active variables.
         *         vector (CV_32S) containing 0-based sample indices or byte vector (CV_8U) containing a mask
         *         of training samples.
         *         <number_of_variables_in_responses>`, containing types of each input and output variable. See
         *         ml::VariableTypes.
         * return automatically generated
         */
        public static TrainData create(Mat samples, int layout, Mat responses)
        {
            if (samples != null)
            {
                samples.ThrowIfDisposed();
            }
            if (responses != null)
            {
                responses.ThrowIfDisposed();
            }

            return(TrainData.__fromPtr__(ml_TrainData_create_14(samples.nativeObj, layout, responses.nativeObj)));
        }