Changeset 31948

Show
Ignore:
Timestamp:
04/05/09 23:34:21 (4 years ago)
Author:
schima
Message:

cvHoughCircles

Location:
lang/cpluspluscli/OpenCvSharp2/trunk/OpenCvSharp
Files:
1 added
7 modified

Legend:

Unmodified
Added
Removed
  • lang/cpluspluscli/OpenCvSharp2/trunk/OpenCvSharp/Class/CvHuMoments.cs

    r31866 r31948  
    1010{ 
    1111    /// <summary> 
    12     ///  
     12    /// Hu moments 
    1313    /// </summary> 
    1414    [Serializable] 
     
    3333#else 
    3434        /// <summary> 
    35         ///  
     35        /// Initialize by cvGetHuMoments 
    3636        /// </summary> 
    37         /// <param name="moments"></param> 
     37        /// <param name="moments">Pointer to the moment state structure. </param> 
    3838#endif 
    3939        public CvHuMoments(CvMoments moments) 
  • lang/cpluspluscli/OpenCvSharp2/trunk/OpenCvSharp/Class/CvMoments.cs

    r31866 r31948  
    1010{ 
    1111    /// <summary> 
    12     ///  
     12    /// Moment state structure  
    1313    /// </summary> 
    1414    [Serializable] 
     
    3838#else 
    3939        /// <summary> 
    40         ///  
     40        /// Initialize by cvMoments 
    4141        /// </summary> 
    42         /// <param name="arr"></param> 
    43         /// <param name="binary"></param> 
     42        /// <param name="arr">Image (1-channel or 3-channel with COI set) or polygon (CvSeq of points or a vector of points). </param> 
     43        /// <param name="binary">(For images only) If the flag is non-zero, all the zero pixel values are treated as zeroes, all the others are treated as 1’s. </param> 
    4444#endif 
    4545        public CvMoments(CvArr arr, bool binary) 
  • lang/cpluspluscli/OpenCvSharp2/trunk/OpenCvSharp/Core/CvDll.cs

    r31924 r31948  
    175175        public static extern IntPtr cvHoughLines2(IntPtr image, IntPtr line_storage, HoughLinesMethod method, double rho, double theta, int threshold, double param1, double param2); 
    176176        [DllImport(DLL_CV)] 
    177         public static extern IntPtr cvHoughCircles(IntPtr image, IntPtr circleStorage, HoughCirclesMethod method, double dp, double min_dist, double param1, double param2, int min_radius, int max_radius); 
     177        public static extern IntPtr cvHoughCircles(IntPtr image, IntPtr circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1, double param2, int min_radius, int max_radius); 
    178178        [DllImport(DLL_CV)] 
    179179        public static extern void cvInitSubdivDelaunay2D(IntPtr subdiv, CvRect rect); 
  • lang/cpluspluscli/OpenCvSharp2/trunk/OpenCvSharp/Core/Cv_D-H.cs

    r31945 r31948  
    29242924        } 
    29252925        #endregion 
     2926        #region HoughCircles 
     2927        #region circle_storage = CvMemStorage 
     2928#if LANG_JP 
     2929        /// <summary> 
     2930        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     2931        /// </summary> 
     2932        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     2933        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     2934        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     2935        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     2936        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     2937        /// <returns></returns> 
     2938#else 
     2939        /// <summary> 
     2940        /// Finds circles in grayscale image using Hough transform. 
     2941        /// </summary> 
     2942        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     2943        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     2944        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     2945        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     2946        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     2947        /// <returns></returns> 
     2948#endif 
     2949        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMemStorage circle_storage, HoughCirclesMethod method, double dp, double min_dist) 
     2950        { 
     2951            return HoughCircles(image, circle_storage, method, dp, min_dist, 100, 100, 0, 0); 
     2952        } 
     2953#if LANG_JP 
     2954        /// <summary> 
     2955        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     2956        /// </summary> 
     2957        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     2958        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     2959        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     2960        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     2961        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     2962        /// <param name="param1">手法に応じた1番目のパラメータ. CV_HOUGH_GRADIENT の場合は,Cannyのエッジ検出器で用いる二つの閾値の高い方の値 (低い方の値は,この値を1/2したものになる).</param> 
     2963        /// <returns></returns> 
     2964#else 
     2965        /// <summary> 
     2966        /// Finds circles in grayscale image using Hough transform. 
     2967        /// </summary> 
     2968        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     2969        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     2970        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     2971        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     2972        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     2973        /// <param name="param1">The first method-specific parameter. In case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny edge detector (the lower one will be twice smaller). </param> 
     2974        /// <returns></returns> 
     2975#endif 
     2976        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMemStorage circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1) 
     2977        { 
     2978            return HoughCircles(image, circle_storage, method, dp, min_dist, param1, 100, 0, 0); 
     2979        } 
     2980#if LANG_JP 
     2981        /// <summary> 
     2982        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     2983        /// </summary> 
     2984        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     2985        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     2986        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     2987        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     2988        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     2989        /// <param name="param1">手法に応じた1番目のパラメータ. CV_HOUGH_GRADIENT の場合は,Cannyのエッジ検出器で用いる二つの閾値の高い方の値 (低い方の値は,この値を1/2したものになる).</param> 
     2990        /// <param name="param2">手法に応じた2番目のパラメータ. CV_HOUGH_GRADIENT の場合は,中心検出計算時の閾値.小さすぎると誤検出が多くなる.これに対応する値が大きい円から順に検出される.</param> 
     2991        /// <returns></returns> 
     2992#else 
     2993        /// <summary> 
     2994        /// Finds circles in grayscale image using Hough transform. 
     2995        /// </summary> 
     2996        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     2997        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     2998        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     2999        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     3000        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     3001        /// <param name="param1">The first method-specific parameter. In case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny edge detector (the lower one will be twice smaller). </param> 
     3002        /// <param name="param2">The second method-specific parameter. In case of CV_HOUGH_GRADIENT it is accumulator threshold at the center detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first. </param> 
     3003        /// <returns></returns> 
     3004#endif 
     3005        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMemStorage circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1, double param2) 
     3006        { 
     3007            return HoughCircles(image, circle_storage, method, dp, min_dist, param1, param2, 0, 0); 
     3008        } 
     3009#if LANG_JP 
     3010        /// <summary> 
     3011        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     3012        /// </summary> 
     3013        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     3014        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     3015        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     3016        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     3017        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     3018        /// <param name="param1">手法に応じた1番目のパラメータ. CV_HOUGH_GRADIENT の場合は,Cannyのエッジ検出器で用いる二つの閾値の高い方の値 (低い方の値は,この値を1/2したものになる).</param> 
     3019        /// <param name="param2">手法に応じた2番目のパラメータ. CV_HOUGH_GRADIENT の場合は,中心検出計算時の閾値.小さすぎると誤検出が多くなる.これに対応する値が大きい円から順に検出される.</param> 
     3020        /// <param name="min_radius">検出すべき円の最小半径.</param> 
     3021        /// <returns></returns> 
     3022#else 
     3023        /// <summary> 
     3024        /// Finds circles in grayscale image using Hough transform. 
     3025        /// </summary> 
     3026        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     3027        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     3028        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     3029        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     3030        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     3031        /// <param name="param1">The first method-specific parameter. In case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny edge detector (the lower one will be twice smaller). </param> 
     3032        /// <param name="param2">The second method-specific parameter. In case of CV_HOUGH_GRADIENT it is accumulator threshold at the center detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first. </param> 
     3033        /// <param name="min_radius">Minimal radius of the circles to search for. </param> 
     3034        /// <returns></returns> 
     3035#endif 
     3036        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMemStorage circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1, double param2, int min_radius) 
     3037        { 
     3038            return HoughCircles(image, circle_storage, method, dp, min_dist, param1, param2, min_radius, 0); 
     3039        } 
     3040#if LANG_JP 
     3041        /// <summary> 
     3042        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     3043        /// </summary> 
     3044        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     3045        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     3046        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     3047        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     3048        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     3049        /// <param name="param1">手法に応じた1番目のパラメータ. CV_HOUGH_GRADIENT の場合は,Cannyのエッジ検出器で用いる二つの閾値の高い方の値 (低い方の値は,この値を1/2したものになる).</param> 
     3050        /// <param name="param2">手法に応じた2番目のパラメータ. CV_HOUGH_GRADIENT の場合は,中心検出計算時の閾値.小さすぎると誤検出が多くなる.これに対応する値が大きい円から順に検出される.</param> 
     3051        /// <param name="min_radius">検出すべき円の最小半径.</param> 
     3052        /// <param name="max_radius">検出すべき円の最大半径 デフォルトの最大半径は max(image_width, image_height) にセットされている.</param> 
     3053        /// <returns></returns> 
     3054#else 
     3055        /// <summary> 
     3056        /// Finds circles in grayscale image using Hough transform. 
     3057        /// </summary> 
     3058        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     3059        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     3060        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     3061        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     3062        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     3063        /// <param name="param1">The first method-specific parameter. In case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny edge detector (the lower one will be twice smaller). </param> 
     3064        /// <param name="param2">The second method-specific parameter. In case of CV_HOUGH_GRADIENT it is accumulator threshold at the center detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first. </param> 
     3065        /// <param name="min_radius">Minimal radius of the circles to search for. </param> 
     3066        /// <param name="max_radius">Maximal radius of the circles to search for. By default the maximal radius is set to max(image_width, image_height). </param> 
     3067        /// <returns></returns> 
     3068#endif 
     3069        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMemStorage circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1, double param2, int min_radius, int max_radius) 
     3070        { 
     3071            if (image == null) 
     3072                throw new ArgumentNullException("image"); 
     3073            if (circle_storage == null) 
     3074                throw new ArgumentNullException("circle_storage"); 
     3075            IntPtr result = CvDll.cvHoughCircles(image.CvPtr, circle_storage.CvPtr, method, dp, min_dist, param1, param2, min_radius, max_radius); 
     3076            if (result == IntPtr.Zero) 
     3077                return null; 
     3078            else 
     3079                return new CvSeq<CvCircleSegment>(result); 
     3080        } 
     3081        #endregion 
     3082        #region circle_storage = CvMat 
     3083#if LANG_JP 
     3084        /// <summary> 
     3085        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     3086        /// </summary> 
     3087        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     3088        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     3089        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     3090        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     3091        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     3092        /// <returns></returns> 
     3093#else 
     3094        /// <summary> 
     3095        /// Finds circles in grayscale image using Hough transform. 
     3096        /// </summary> 
     3097        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     3098        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     3099        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     3100        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     3101        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     3102        /// <returns></returns> 
     3103#endif 
     3104        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMat circle_storage, HoughCirclesMethod method, double dp, double min_dist) 
     3105        { 
     3106            return HoughCircles(image, circle_storage, method, dp, min_dist, 100, 100, 0, 0); 
     3107        } 
     3108#if LANG_JP 
     3109        /// <summary> 
     3110        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     3111        /// </summary> 
     3112        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     3113        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     3114        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     3115        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     3116        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     3117        /// <param name="param1">手法に応じた1番目のパラメータ. CV_HOUGH_GRADIENT の場合は,Cannyのエッジ検出器で用いる二つの閾値の高い方の値 (低い方の値は,この値を1/2したものになる).</param> 
     3118        /// <returns></returns> 
     3119#else 
     3120        /// <summary> 
     3121        /// Finds circles in grayscale image using Hough transform. 
     3122        /// </summary> 
     3123        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     3124        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     3125        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     3126        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     3127        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     3128        /// <param name="param1">The first method-specific parameter. In case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny edge detector (the lower one will be twice smaller). </param> 
     3129        /// <returns></returns> 
     3130#endif 
     3131        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMat circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1) 
     3132        { 
     3133            return HoughCircles(image, circle_storage, method, dp, min_dist, param1, 100, 0, 0); 
     3134        } 
     3135#if LANG_JP 
     3136        /// <summary> 
     3137        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     3138        /// </summary> 
     3139        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     3140        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     3141        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     3142        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     3143        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     3144        /// <param name="param1">手法に応じた1番目のパラメータ. CV_HOUGH_GRADIENT の場合は,Cannyのエッジ検出器で用いる二つの閾値の高い方の値 (低い方の値は,この値を1/2したものになる).</param> 
     3145        /// <param name="param2">手法に応じた2番目のパラメータ. CV_HOUGH_GRADIENT の場合は,中心検出計算時の閾値.小さすぎると誤検出が多くなる.これに対応する値が大きい円から順に検出される.</param> 
     3146        /// <returns></returns> 
     3147#else 
     3148        /// <summary> 
     3149        /// Finds circles in grayscale image using Hough transform. 
     3150        /// </summary> 
     3151        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     3152        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     3153        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     3154        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     3155        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     3156        /// <param name="param1">The first method-specific parameter. In case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny edge detector (the lower one will be twice smaller). </param> 
     3157        /// <param name="param2">The second method-specific parameter. In case of CV_HOUGH_GRADIENT it is accumulator threshold at the center detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first. </param> 
     3158        /// <returns></returns> 
     3159#endif 
     3160        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMat circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1, double param2) 
     3161        { 
     3162            return HoughCircles(image, circle_storage, method, dp, min_dist, param1, param2, 0, 0); 
     3163        } 
     3164#if LANG_JP 
     3165        /// <summary> 
     3166        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     3167        /// </summary> 
     3168        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     3169        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     3170        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     3171        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     3172        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     3173        /// <param name="param1">手法に応じた1番目のパラメータ. CV_HOUGH_GRADIENT の場合は,Cannyのエッジ検出器で用いる二つの閾値の高い方の値 (低い方の値は,この値を1/2したものになる).</param> 
     3174        /// <param name="param2">手法に応じた2番目のパラメータ. CV_HOUGH_GRADIENT の場合は,中心検出計算時の閾値.小さすぎると誤検出が多くなる.これに対応する値が大きい円から順に検出される.</param> 
     3175        /// <param name="min_radius">検出すべき円の最小半径.</param> 
     3176        /// <returns></returns> 
     3177#else 
     3178        /// <summary> 
     3179        /// Finds circles in grayscale image using Hough transform. 
     3180        /// </summary> 
     3181        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     3182        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     3183        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     3184        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     3185        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     3186        /// <param name="param1">The first method-specific parameter. In case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny edge detector (the lower one will be twice smaller). </param> 
     3187        /// <param name="param2">The second method-specific parameter. In case of CV_HOUGH_GRADIENT it is accumulator threshold at the center detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first. </param> 
     3188        /// <param name="min_radius">Minimal radius of the circles to search for. </param> 
     3189        /// <returns></returns> 
     3190#endif 
     3191        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMat circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1, double param2, int min_radius) 
     3192        { 
     3193            return HoughCircles(image, circle_storage, method, dp, min_dist, param1, param2, min_radius, 0); 
     3194        } 
     3195#if LANG_JP 
     3196        /// <summary> 
     3197        /// ハフ変換を用いてグレースケール画像中の円を検出する 
     3198        /// </summary> 
     3199        /// <param name="image">入力画像 (8ビット,シングルチャンネル,グレースケール).</param> 
     3200        /// <param name="circle_storage">検出された円を保存するメモリストレージ</param> 
     3201        /// <param name="method">現状では,CV_HOUGH_GRADIENT(基本的な2段階のハフ変換)のみ実装されている. </param> 
     3202        /// <param name="dp">円の中心を求める際に用いられる計算時の解像度.例えば,この値が 1 の場合は,計算は入力画像と同じ解像度で行われる.2 の場合は,計算は幅・高さともに1/2の解像度になる,等. </param> 
     3203        /// <param name="min_dist">円検出における中心座標間の最小間隔.この値が非常に小さい場合は,正しく抽出されるべき円の近傍に複数の間違った円が検出されることになる.また,逆に非常に大きい場合は,円検出に失敗する. </param> 
     3204        /// <param name="param1">手法に応じた1番目のパラメータ. CV_HOUGH_GRADIENT の場合は,Cannyのエッジ検出器で用いる二つの閾値の高い方の値 (低い方の値は,この値を1/2したものになる).</param> 
     3205        /// <param name="param2">手法に応じた2番目のパラメータ. CV_HOUGH_GRADIENT の場合は,中心検出計算時の閾値.小さすぎると誤検出が多くなる.これに対応する値が大きい円から順に検出される.</param> 
     3206        /// <param name="min_radius">検出すべき円の最小半径.</param> 
     3207        /// <param name="max_radius">検出すべき円の最大半径 デフォルトの最大半径は max(image_width, image_height) にセットされている.</param> 
     3208        /// <returns></returns> 
     3209#else 
     3210        /// <summary> 
     3211        /// Finds circles in grayscale image using Hough transform. 
     3212        /// </summary> 
     3213        /// <param name="image">The input 8-bit single-channel grayscale image. </param> 
     3214        /// <param name="circle_storage">The storage for the circles detected. It can be a memory storage or single row/single column matrix (CvMat*) of type CV_32FC3, to which the circles' parameters are written. </param> 
     3215        /// <param name="method">Currently, the only implemented method is CV_HOUGH_GRADIENT, which is basically 21HT</param> 
     3216        /// <param name="dp">Resolution of the accumulator used to detect centers of the circles. For example, if it is 1, the accumulator will have the same resolution as the input image, if it is 2 - accumulator will have twice smaller width and height, etc. </param> 
     3217        /// <param name="min_dist">Minimum distance between centers of the detected circles. If the parameter is too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is too large, some circles may be missed. </param> 
     3218        /// <param name="param1">The first method-specific parameter. In case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny edge detector (the lower one will be twice smaller). </param> 
     3219        /// <param name="param2">The second method-specific parameter. In case of CV_HOUGH_GRADIENT it is accumulator threshold at the center detection stage. The smaller it is, the more false circles may be detected. Circles, corresponding to the larger accumulator values, will be returned first. </param> 
     3220        /// <param name="min_radius">Minimal radius of the circles to search for. </param> 
     3221        /// <param name="max_radius">Maximal radius of the circles to search for. By default the maximal radius is set to max(image_width, image_height). </param> 
     3222        /// <returns></returns> 
     3223#endif 
     3224        public static CvSeq<CvCircleSegment> HoughCircles(this CvArr image, CvMat circle_storage, HoughCirclesMethod method, double dp, double min_dist, double param1, double param2, int min_radius, int max_radius) 
     3225        { 
     3226            if (image == null) 
     3227                throw new ArgumentNullException("image"); 
     3228            if (circle_storage == null) 
     3229                throw new ArgumentNullException("circle_storage"); 
     3230            IntPtr result = CvDll.cvHoughCircles(image.CvPtr, circle_storage.CvPtr, method, dp, min_dist, param1, param2, min_radius, max_radius); 
     3231            if (result == IntPtr.Zero) 
     3232                return null; 
     3233            else 
     3234                return new CvSeq<CvCircleSegment>(result); 
     3235        } 
     3236        #endregion 
     3237        #endregion 
    29263238        #region HoughLines2 
     3239#if LANG_JP 
    29273240        /// <summary> 
    29283241        /// ハフ(Hough)変換を用いて2値画像から直線を検出する 
     
    29353248        /// <param name="threshold">閾値パラメータ.対応する投票数がthresholdより大きい場合のみ,抽出された線が返される.</param> 
    29363249        /// <returns></returns> 
     3250#else 
     3251        /// <summary> 
     3252        /// Finds lines in binary image using Hough transform. 
     3253        /// </summary> 
     3254        /// <param name="image">The input 8-bit single-channel binary image. In case of probabilistic method the image is modified by the function. </param> 
     3255        /// <param name="line_storage">The storage for the lines detected. It can be a memory storage or single row/single column matrix (CvMat*) of a particular type to which the lines' parameters are written. </param> 
     3256        /// <param name="method">The Hough transform variant.</param> 
     3257        /// <param name="rho">Distance resolution in pixel-related units. </param> 
     3258        /// <param name="theta">Angle resolution measured in radians. </param> 
     3259        /// <param name="threshold">Threshold parameter. A line is returned by the function if the corresponding accumulator value is greater than threshold. </param> 
     3260        /// <returns></returns> 
     3261#endif 
    29373262        public static CvSeq HoughLines2(this CvArr image, CvMemStorage line_storage, HoughLinesMethod method, double rho, double theta, int threshold) 
    29383263        { 
    29393264            return HoughLines2(image, line_storage, method, rho, theta, threshold, 0, 0); 
    29403265        } 
     3266#if LANG_JP 
    29413267        /// <summary> 
    29423268        /// ハフ(Hough)変換を用いて2値画像から直線を検出する 
     
    29513277        /// <param name="param2">各手法に応じた2番目のパラメータ.標準的ハフ変換では,使用しない(0).確率的ハフ変換では,同一線上に存在する線分として扱う(つまり,それらを統合しても問題ない),二つの線分の最大の間隔. マルチスケールハフ変換では,角度解像度 thetaの除数. (荒い角度解像度では theta であり,詳細な解像度では (theta / param2) となる). </param> 
    29523278        /// <returns></returns> 
     3279#else 
     3280        /// <summary> 
     3281        /// Finds lines in binary image using Hough transform. 
     3282        /// </summary> 
     3283        /// <param name="image">The input 8-bit single-channel binary image. In case of probabilistic method the image is modified by the function. </param> 
     3284        /// <param name="line_storage">The storage for the lines detected. It can be a memory storage or single row/single column matrix (CvMat*) of a particular type to which the lines' parameters are written. </param> 
     3285        /// <param name="method">The Hough transform variant.</param> 
     3286        /// <param name="rho">Distance resolution in pixel-related units. </param> 
     3287        /// <param name="theta">Angle resolution measured in radians. </param> 
     3288        /// <param name="threshold">Threshold parameter. A line is returned by the function if the corresponding accumulator value is greater than threshold. </param> 
     3289        /// <param name="param1">The first method-dependent parameter.</param> 
     3290        /// <param name="param2">The second method-dependent parameter.</param> 
     3291        /// <returns></returns> 
     3292#endif 
    29533293        public static CvSeq HoughLines2(this CvArr image, CvMemStorage line_storage, HoughLinesMethod method, double rho, double theta, int threshold, double param1, double param2) 
    29543294        { 
     
    29603300            return new CvSeq(result); 
    29613301        } 
     3302#if LANG_JP 
    29623303        /// <summary> 
    29633304        /// ハフ(Hough)変換を用いて2値画像から直線を検出する 
     
    29703311        /// <param name="threshold">閾値パラメータ.対応する投票数がthresholdより大きい場合のみ,抽出された線が返される.</param> 
    29713312        /// <returns></returns> 
     3313#else 
     3314        /// <summary> 
     3315        /// Finds lines in binary image using Hough transform. 
     3316        /// </summary> 
     3317        /// <param name="image">The input 8-bit single-channel binary image. In case of probabilistic method the image is modified by the function. </param> 
     3318        /// <param name="line_storage">The storage for the lines detected. It can be a memory storage or single row/single column matrix (CvMat*) of a particular type to which the lines' parameters are written. </param> 
     3319        /// <param name="method">The Hough transform variant.</param> 
     3320        /// <param name="rho">Distance resolution in pixel-related units. </param> 
     3321        /// <param name="theta">Angle resolution measured in radians. </param> 
     3322        /// <param name="threshold">Threshold parameter. A line is returned by the function if the corresponding accumulator value is greater than threshold. </param> 
     3323        /// <returns></returns> 
     3324#endif 
    29723325        public static CvSeq HoughLines2(this CvArr image, CvMat line_storage, HoughLinesMethod method, double rho, double theta, int threshold) 
    29733326        { 
    29743327            return HoughLines2(image, line_storage, method, rho, theta, threshold, 0, 0); 
    29753328        } 
     3329#if LANG_JP 
    29763330        /// <summary> 
    29773331        /// ハフ(Hough)変換を用いて2値画像から直線を検出する 
     
    29863340        /// <param name="param2">各手法に応じた2番目のパラメータ.標準的ハフ変換では,使用しない(0).確率的ハフ変換では,同一線上に存在する線分として扱う(つまり,それらを統合しても問題ない),二つの線分の最大の間隔. マルチスケールハフ変換では,角度解像度 thetaの除数. (荒い角度解像度では theta であり,詳細な解像度では (theta / param2) となる). </param> 
    29873341        /// <returns></returns> 
     3342#else 
     3343        /// <summary> 
     3344        /// Finds lines in binary image using Hough transform. 
     3345        /// </summary> 
     3346        /// <param name="image">The input 8-bit single-channel binary image. In case of probabilistic method the image is modified by the function. </param> 
     3347        /// <param name="line_storage">The storage for the lines detected. It can be a memory storage or single row/single column matrix (CvMat*) of a particular type to which the lines' parameters are written. </param> 
     3348        /// <param name="method">The Hough transform variant.</param> 
     3349        /// <param name="rho">Distance resolution in pixel-related units. </param> 
     3350        /// <param name="theta">Angle resolution measured in radians. </param> 
     3351        /// <param name="threshold">Threshold parameter. A line is returned by the function if the corresponding accumulator value is greater than threshold. </param> 
     3352        /// <param name="param1">The first method-dependent parameter.</param> 
     3353        /// <param name="param2">The second method-dependent parameter.</param> 
     3354        /// <returns></returns> 
     3355#endif 
    29883356        public static CvSeq HoughLines2(this CvArr image, CvMat line_storage, HoughLinesMethod method, double rho, double theta, int threshold, double param1, double param2) 
    29893357        { 
  • lang/cpluspluscli/OpenCvSharp2/trunk/OpenCvSharp/OpenCvSharp.csproj

    r31914 r31948  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    6     <ProductVersion>9.0.21022</ProductVersion> 
     6    <ProductVersion>9.0.30729</ProductVersion> 
    77    <SchemaVersion>2.0</SchemaVersion> 
    88    <ProjectGuid>{4C2356B8-1A1E-4F92-A51C-A49CA116867F}</ProjectGuid> 
     
    166166    <Compile Include="Enum\PCAFlag.cs" /> 
    167167    <Compile Include="Enum\ConvertImageFlag.cs" /> 
     168    <Compile Include="Struct\CvCircleSegment.cs" /> 
    168169    <Compile Include="Tool\ArrayAddress.cs" /> 
    169170    <Compile Include="Class\CvConnectedComp.cs" /> 
  • lang/cpluspluscli/OpenCvSharp2/trunk/OpenCvSharp/Struct/CvLineSegmentPoint.cs

    r31460 r31948  
    77namespace KwsmLab.OpenCvSharp 
    88{ 
     9#if LANG_JP 
    910    /// <summary> 
    1011    /// cvHoughLines2で得られる、両端の点で表現される線分 
    1112    /// </summary> 
     13#else 
     14    /// <summary> 
     15    /// Line segment structure retrieved by cvHoughLines2 
     16    /// </summary> 
     17#endif 
    1218    [Serializable] 
    1319    [StructLayout(LayoutKind.Sequential)] 
    1420    public struct CvLineSegmentPoint : IEquatable<CvLineSegmentPoint> 
    1521    { 
     22#if LANG_JP 
    1623        /// <summary> 
    1724        /// 1つ目の点 
    1825        /// </summary> 
     26#else 
     27        /// <summary> 
     28        /// 1st Point 
     29        /// </summary> 
     30#endif 
    1931        public CvPoint P1; 
     32#if LANG_JP 
    2033        /// <summary> 
    2134        /// 2つ目の点 
    2235        /// </summary> 
     36#else 
     37        /// <summary> 
     38        /// 2nd Point 
     39        /// </summary> 
     40#endif 
    2341        public CvPoint P2; 
    2442 
    2543 
     44#if LANG_JP 
    2645        /// <summary> 
    2746        /// 初期化 
     
    2948        /// <param name="p1">1つ目の点</param> 
    3049        /// <param name="p2">2つ目の点</param> 
     50#else 
     51        /// <summary> 
     52        /// Constructor 
     53        /// </summary> 
     54        /// <param name="p1">1st Point</param> 
     55        /// <param name="p2">2nd Point</param> 
     56#endif 
    3157        public CvLineSegmentPoint(CvPoint p1, CvPoint p2) 
    3258        { 
  • lang/cpluspluscli/OpenCvSharp2/trunk/OpenCvSharp/Struct/CvLineSegmentPolar.cs

    r31460 r31948  
    77namespace KwsmLab.OpenCvSharp 
    88{ 
     9#if LANG_JP 
    910    /// <summary> 
    1011    /// cvHoughLines2で得られる、極座標系で表現される線分 
    1112    /// </summary> 
     13#else 
     14    /// <summary> 
     15    /// Polar line segment retrieved by cvHoughLines2 
     16    /// </summary> 
     17#endif 
    1218    [Serializable] 
    1319    [StructLayout(LayoutKind.Sequential)] 
    1420    public struct CvLineSegmentPolar : IEquatable<CvLineSegmentPolar> 
    1521    { 
     22#if LANG_JP 
    1623        /// <summary> 
    1724        /// 線分の長さ 
    1825        /// </summary> 
     26#else 
     27        /// <summary> 
     28        /// Length of the line 
     29        /// </summary> 
     30#endif 
    1931        public float Rho; 
     32#if LANG_JP 
    2033        /// <summary> 
    2134        /// 線分の角度(ラジアン) 
    2235        /// </summary> 
     36#else 
     37        /// <summary> 
     38        /// Angle of the line (radian) 
     39        /// </summary> 
     40#endif 
    2341        public float Theta; 
    2442 
    2543 
     44#if LANG_JP 
    2645        /// <summary> 
    2746        /// 初期化 
     
    2948        /// <param name="rho">線分の長さ</param> 
    3049        /// <param name="theta">線分の角度(ラジアン)</param> 
     50#else 
     51        /// <summary> 
     52        /// Constructor 
     53        /// </summary> 
     54        /// <param name="rho">Length of the line</param> 
     55        /// <param name="theta">Angle of the line (radian)</param> 
     56#endif 
    3157        public CvLineSegmentPolar(float rho, float theta) 
    3258        {