/// <summary> /// 輪郭の周囲長または曲線の長さを計算する /// </summary> /// <param name="curve">配列</param> /// <param name="slice">曲線の始点と終点.デフォルトでは曲線の全ての長さが計算される.</param> /// <param name="isClosed">閉曲線かどうかを示す.次の3つの状態がある: /// is_closed=0 - 曲線は閉曲線として扱われない. /// is_closed>0 - 曲線は閉曲線として扱われる. /// is_closed<0 - 曲線がシーケンスの場合, ((CvSeq*)curve)->flagsのフラグCV_SEQ_FLAG_CLOSEDから閉曲線かどうかを判別する.そうでない(曲線が点の配列(CvMat*)で表現される)場合,閉曲線として扱われない. /// </param> /// <returns>輪郭の周囲長または曲線の長さ</returns> #else /// <summary> /// Calculates contour perimeter or curve length /// </summary> /// <param name="curve">Sequence or array of the curve points. </param> /// <param name="slice">Starting and ending points of the curve, by default the whole curve length is calculated. </param> /// <param name="isClosed">Indicates whether the curve is closed or not. There are 3 cases: /// * is_closed=0 - the curve is assumed to be unclosed. /// * is_closed>0 - the curve is assumed to be closed. /// * is_closed<0 - if curve is sequence, the flag CV_SEQ_FLAG_CLOSED of ((CvSeq*)curve)->flags is checked to determine if the curve is closed or not, otherwise (curve is represented by array (CvMat*) of points) it is assumed to be unclosed. </param> /// <returns></returns> #endif public static double ArcLength(CvArr curve, CvSlice slice, int isClosed) { if (curve == null) { throw new ArgumentNullException("curve"); } return(NativeMethods.cvArcLength(curve.CvPtr, slice, isClosed)); }
/// <summary> /// 輪郭の周囲長または曲線の長さを計算する /// </summary> /// <param name="curve">配列</param> /// <param name="slice">曲線の始点と終点.デフォルトでは曲線の全ての長さが計算される.</param> /// <param name="isClosed">閉曲線かどうかを示す.次の3つの状態がある: /// is_closed=0 - 曲線は閉曲線として扱われない. /// is_closed>0 - 曲線は閉曲線として扱われる. /// is_closed<0 - 曲線がシーケンスの場合, ((CvSeq*)curve)->flagsのフラグCV_SEQ_FLAG_CLOSEDから閉曲線かどうかを判別する.そうでない(曲線が点の配列(CvMat*)で表現される)場合,閉曲線として扱われない. /// </param> /// <returns>輪郭の周囲長または曲線の長さ</returns> #else /// <summary> /// Calculates contour perimeter or curve length /// </summary> /// <param name="curve">Sequence or array of the curve points. </param> /// <param name="slice">Starting and ending points of the curve, by default the whole curve length is calculated. </param> /// <param name="isClosed">Indicates whether the curve is closed or not. There are 3 cases: /// * is_closed=0 - the curve is assumed to be unclosed. /// * is_closed>0 - the curve is assumed to be closed. /// * is_closed<0 - if curve is sequence, the flag CV_SEQ_FLAG_CLOSED of ((CvSeq*)curve)->flags is checked to determine if the curve is closed or not, otherwise (curve is represented by array (CvMat*) of points) it is assumed to be unclosed. </param> /// <returns></returns> #endif public static double ArcLength(CvArr curve, CvSlice slice, int isClosed) { if (curve == null) { throw new ArgumentNullException(nameof(curve)); } double ret = NativeMethods.cvArcLength(curve.CvPtr, slice, isClosed); GC.KeepAlive(curve); return(ret); }
/// <summary> /// 輪郭の周囲長または曲線の長さを計算する /// </summary> /// <param name="curve">配列</param> /// <param name="slice">曲線の始点と終点.デフォルトでは曲線の全ての長さが計算される.</param> /// <returns>輪郭の周囲長または曲線の長さ</returns> #else /// <summary> /// Calculates contour perimeter or curve length /// </summary> /// <param name="curve">Sequence or array of the curve points. </param> /// <param name="slice">Starting and ending points of the curve, by default the whole curve length is calculated. </param> /// <returns></returns> #endif public static double ArcLength(CvArr curve, CvSlice slice) { return(ArcLength(curve, slice, -1)); }
/// <summary> /// シーケンスをメモリ内の連続した一つのブロックにコピーする (cvCvtSeqToArray). /// </summary> /// <param name="slice">配列へコピーするシーケンス内の部分</param> /// <returns>出力される配列. outされる引数 element と同じ値.</returns> #else /// <summary> /// Copies sequence to one continuous block of memory (cvCvtSeqToArray). /// </summary> /// <param name="slice">The sequence part to copy to the array. </param> /// <returns></returns> #endif public T[] ToArray(CvSlice slice) { T[] elements; return(Cv.CvtSeqToArray(this, out elements, slice)); }
/// <summary> /// シーケンススライスのための別のヘッダを作成する (cvSeqSlice). /// </summary> /// <param name="slice">抽出するシーケンスの一部分</param> /// <param name="storage">新しいシーケンスヘッダとコピーされたデータ(もしデータがあれば)を保存する出力ストレージ. nullの場合,この関数は入力シーケンスに含まれるストレージを使用する</param> /// <param name="copyData">抽出されたスライスの要素をコピーするかしないかを示すフラグ</param> /// <returns></returns> #else /// <summary> /// Makes separate header for the sequence slice (cvSeqSlice). /// </summary> /// <param name="slice">The part of the sequence to extract. </param> /// <param name="storage">The destination storage to keep the new sequence header and the copied data if any. If it is null, the function uses the storage containing the input sequence. </param> /// <param name="copyData">The flag that indicates whether to copy the elements of the extracted slice (copy_data=true) or not (copy_data=false) </param> /// <returns></returns> #endif new public CvSeq <T> Slice(CvSlice slice, CvMemStorage storage, bool copyData) { return(Cv.SeqSlice(this, slice, storage, copyData)); }
/// <summary> /// シーケンススライスのための別のヘッダを作成する (cvSeqSlice). /// </summary> /// <param name="slice">抽出するシーケンスの一部分</param> /// <param name="storage">新しいシーケンスヘッダとコピーされたデータ(もしデータがあれば)を保存する出力ストレージ. nullの場合,この関数は入力シーケンスに含まれるストレージを使用する</param> /// <returns></returns> #else /// <summary> /// Makes separate header for the sequence slice (cvSeqSlice). /// </summary> /// <param name="slice">The part of the sequence to extract. </param> /// <param name="storage">The destination storage to keep the new sequence header and the copied data if any. If it is null, the function uses the storage containing the input sequence. </param> /// <returns></returns> #endif new public CvSeq <T> Slice(CvSlice slice, CvMemStorage storage) { return(Cv.SeqSlice(this, slice, storage)); }
/// <summary> /// シーケンススライスのための別のヘッダを作成する (cvSeqSlice). /// </summary> /// <param name="slice">抽出するシーケンスの一部分</param> /// <returns></returns> #else /// <summary> /// Makes separate header for the sequence slice (cvSeqSlice). /// </summary> /// <param name="slice">The part of the sequence to extract. </param> /// <returns></returns> #endif new public CvSeq <T> Slice(CvSlice slice) { return(Cv.SeqSlice(this, slice)); }
/// <summary> /// シーケンススライスのための別のヘッダを作成する (cvSeqSlice). /// </summary> /// <param name="slice">抽出するシーケンスの一部分</param> /// <param name="storage">新しいシーケンスヘッダとコピーされたデータ(もしデータがあれば)を保存する出力ストレージ. nullの場合,この関数は入力シーケンスに含まれるストレージを使用する</param> /// <param name="copyData">抽出されたスライスの要素をコピーするかしないかを示すフラグ</param> /// <returns></returns> #else /// <summary> /// Makes separate header for the sequence slice (cvSeqSlice). /// </summary> /// <param name="slice">The part of the sequence to extract. </param> /// <param name="storage">The destination storage to keep the new sequence header and the copied data if any. If it is null, the function uses the storage containing the input sequence. </param> /// <param name="copyData">The flag that indicates whether to copy the elements of the extracted slice (copy_data=true) or not (copy_data=false) </param> /// <returns></returns> #endif public virtual CvSeq Slice(CvSlice slice, CvMemStorage storage, bool copyData) { return(Cv.SeqSlice(this, slice, storage, copyData)); }
/// <summary> /// シーケンススライスのための別のヘッダを作成する (cvSeqSlice). /// </summary> /// <param name="slice">抽出するシーケンスの一部分</param> /// <param name="storage">新しいシーケンスヘッダとコピーされたデータ(もしデータがあれば)を保存する出力ストレージ. nullの場合,この関数は入力シーケンスに含まれるストレージを使用する</param> /// <returns></returns> #else /// <summary> /// Makes separate header for the sequence slice (cvSeqSlice). /// </summary> /// <param name="slice">The part of the sequence to extract. </param> /// <param name="storage">The destination storage to keep the new sequence header and the copied data if any. If it is null, the function uses the storage containing the input sequence. </param> /// <returns></returns> #endif public virtual CvSeq Slice(CvSlice slice, CvMemStorage storage) { return(Cv.SeqSlice(this, slice, storage)); }
/// <summary> /// シーケンススライスのための別のヘッダを作成する (cvSeqSlice). /// </summary> /// <param name="slice">抽出するシーケンスの一部分</param> /// <returns></returns> #else /// <summary> /// Makes separate header for the sequence slice (cvSeqSlice). /// </summary> /// <param name="slice">The part of the sequence to extract. </param> /// <returns></returns> #endif public virtual CvSeq Slice(CvSlice slice) { return(Cv.SeqSlice(this, slice)); }
/// <summary> /// シーケンススライスを削除する (cvSeqRemoveSlice). /// </summary> /// <param name="slice">削除するシーケンスの一部分. </param> #else /// <summary> /// Removes sequence slice (cvSeqRemoveSlice). /// </summary> /// <param name="slice">The part of the sequence to remove. </param> #endif public void RemoveSlice(CvSlice slice) { Cv.SeqRemoveSlice(this, slice); }
/// <summary> /// シーケンスをメモリ内の連続した一つのブロックにコピーする (cvCvtSeqToArray). /// </summary> /// <typeparam name="T"></typeparam> /// <param name="slice">配列へコピーするシーケンス内の部分</param> /// <returns>出力される配列. outされる引数 element と同じ値.</returns> #else /// <summary> /// Copies sequence to one continuous block of memory (cvCvtSeqToArray). /// </summary> /// <typeparam name="T"></typeparam> /// <param name="slice">The sequence part to copy to the array. </param> /// <returns></returns> #endif public T[] ToArray <T>(CvSlice slice) where T : struct { T[] elements; return(Cv.CvtSeqToArray(this, out elements, slice)); }