• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# InputArray类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中InputArray的典型用法代码示例。如果您正苦于以下问题:C# InputArray类的具体用法?C# InputArray怎么用?C# InputArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InputArray类属于命名空间,在下文中一共展示了InputArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CamShift

        /// <summary>
        /// Finds an object center, size, and orientation.
        /// </summary>
        /// <param name="probImage">Back projection of the object histogram. </param>
        /// <param name="window">Initial search window.</param>
        /// <param name="criteria">Stop criteria for the underlying MeanShift() .</param>
        /// <returns></returns>
        public static RotatedRect CamShift(
            InputArray probImage, ref Rect window, TermCriteria criteria)
        {
            if (probImage == null)
                throw new ArgumentNullException(nameof(probImage));
            probImage.ThrowIfDisposed();

            RotatedRect result = NativeMethods.video_CamShift(
                probImage.CvPtr, ref window, criteria);
            return result;
        }
开发者ID:shimat,项目名称:opencvsharp,代码行数:18,代码来源:Cv2_video.cs


示例2: Moments

 /// <summary>
 /// Calculates all of the moments 
 /// up to the third order of a polygon or rasterized shape.
 /// </summary>
 /// <param name="array">A raster image (single-channel, 8-bit or floating-point 
 /// 2D array) or an array ( 1xN or Nx1 ) of 2D points ( Point or Point2f )</param>
 /// <param name="binaryImage">If it is true, then all the non-zero image pixels are treated as 1’s</param>
 /// <returns></returns>
 public Moments(InputArray array, bool binaryImage = false)
 {
     if (array == null)
         throw new ArgumentNullException(nameof(array));
     array.ThrowIfDisposed();
     InitializeFromInputArray(array, binaryImage);
 }
开发者ID:shimat,项目名称:opencvsharp,代码行数:15,代码来源:Moments.cs


示例3: SVD

 /// <summary>
 /// the constructor that performs SVD
 /// </summary>
 /// <param name="src"></param>
 /// <param name="flags"></param>
 public SVD(InputArray src, Flags flags = 0)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     src.ThrowIfDisposed();
     ptr = NativeMethods.core_SVD_new(src.CvPtr, (int)flags);
 }
开发者ID:CodeSang,项目名称:opencvsharp,代码行数:12,代码来源:SVD.cs


示例4: Moments

 /// <summary>
 /// computes moments of the rasterized shape or a vector of points
 /// </summary>
 /// <param name="array"></param>
 /// <param name="binaryImage"></param>
 public Moments(InputArray array, bool binaryImage = false)
 {
     if(array == null)
         throw new ArgumentNullException("array");
     array.ThrowIfDisposed();
     WCvMoments m = NativeMethods.imgproc_moments(array.CvPtr, binaryImage ? 1 : 0);
     Initialize(m.m00, m.m10, m.m01, m.m20, m.m11, m.m02, m.m30, m.m21, m.m12, m.m03);
 }
开发者ID:jorik041,项目名称:opencvsharp,代码行数:13,代码来源:Moments.cs


示例5: PCA

 /// <summary>
 /// 
 /// </summary>
 /// <param name="data"></param>
 /// <param name="mean"></param>
 /// <param name="flags"></param>
 /// <param name="retainedVariance"></param>
 public PCA(InputArray data, InputArray mean, Flags flags, double retainedVariance)
 {
     if (data == null)
         throw new ArgumentNullException(nameof(data));
     if (mean == null)
         throw new ArgumentNullException(nameof(mean));
     data.ThrowIfDisposed();
     mean.ThrowIfDisposed();
     ptr = NativeMethods.core_PCA_new3(data.CvPtr, mean.CvPtr, (int)flags, retainedVariance);
 }
开发者ID:shimat,项目名称:opencvsharp,代码行数:17,代码来源:PCA.cs


示例6: MeanShift

        /// <summary>
        /// Finds an object on a back projection image.
        /// </summary>
        /// <param name="probImage">Back projection of the object histogram.</param>
        /// <param name="window">Initial search window.</param>
        /// <param name="criteria">Stop criteria for the iterative search algorithm.</param>
        /// <returns>Number of iterations CAMSHIFT took to converge.</returns>
        public static int MeanShift(
            InputArray probImage, ref Rect window, TermCriteria criteria)
        {
            if (probImage == null)
                throw new ArgumentNullException("probImage");
            probImage.ThrowIfDisposed();

            int result = NativeMethods.video_meanShift(
                probImage.CvPtr, ref window, criteria);
            return result;
        }
开发者ID:CodeSang,项目名称:opencvsharp,代码行数:18,代码来源:Cv2_video.cs


示例7: Index

        /// <summary>
        /// 与えられたデータセットの最近傍探索インデックスを作成します.
        /// </summary>
        /// <param name="features">インデックス作成対象となる特徴(点)が格納された, CV_32F 型の行列.この行列のサイズは matrix is num _ features x feature _ dimensionality となります</param>
        /// <param name="params">params – インデックスパラメータを含む構造体.作成されるインデックスの種類は,このパラメータの種類に依存します</param>
        /// <param name="distType"></param>
#else
        /// <summary>
        /// Constructs a nearest neighbor search index for a given dataset.
        /// </summary>
        /// <param name="features">features – Matrix of type CV _ 32F containing the features(points) to index. The size of the matrix is num _ features x feature _ dimensionality.</param>
        /// <param name="params">Structure containing the index parameters. The type of index that will be constructed depends on the type of this parameter. </param>
        /// <param name="distType"></param>
#endif
        public Index(InputArray features, IndexParams @params, FlannDistance distType = FlannDistance.L2)
        {
            if (features == null)
                throw new ArgumentNullException("features");
            if (@params == null)
                throw new ArgumentNullException("params");

            ptr = NativeMethods.flann_Index_new(features.CvPtr, @params.CvPtr, (int)distType);
            if (ptr == IntPtr.Zero)
                throw new OpenCvSharpException("Failed to create Index");
        }
开发者ID:CodeSang,项目名称:opencvsharp,代码行数:25,代码来源:Index.cs


示例8: ApplyColorMap

 /// <summary>
 /// 
 /// </summary>
 /// <param name="src"></param>
 /// <param name="dst"></param>
 /// <param name="colormap"></param>
 public static void ApplyColorMap(InputArray src, OutputArray dst, ColorMapMode colormap)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     if (dst == null)
         throw new ArgumentNullException("dst");
     src.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     NativeMethods.contrib_applyColorMap(src.CvPtr, dst.CvPtr, (int)colormap);
     dst.Fix();
 }
开发者ID:0sv,项目名称:opencvsharp,代码行数:17,代码来源:Cv2_contrib.cs


示例9: FASTX

 /// <summary>
 /// detects corners using FAST algorithm by E. Rosten
 /// </summary>
 /// <param name="image"></param>
 /// <param name="keypoints"></param>
 /// <param name="threshold"></param>
 /// <param name="nonmaxSupression"></param>
 /// <param name="type"></param>
 public static void FASTX(InputArray image, out KeyPoint[] keypoints, int threshold, bool nonmaxSupression, int type)
 {
     if (image == null)
         throw new ArgumentNullException("image");
     image.ThrowIfDisposed();
     using (var kp = new VectorOfKeyPoint())
     {
         NativeMethods.features2d_FASTX(image.CvPtr, kp.CvPtr, threshold, nonmaxSupression ? 1 : 0, type);
         keypoints = kp.ToArray();
     }
 }
开发者ID:0sv,项目名称:opencvsharp,代码行数:19,代码来源:Cv2_features2d.cs


示例10: MedianBlur

 /// <summary>
 /// 
 /// </summary>
 /// <param name="src"></param>
 /// <param name="dst"></param>
 /// <param name="ksize"></param>
 public static void MedianBlur(InputArray src, OutputArray dst, int ksize)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     if (dst == null)
         throw new ArgumentNullException("dst");
     src.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     NativeMethods.imgproc_medianBlur(src.CvPtr, dst.CvPtr, ksize);
     dst.Fix();
 }
开发者ID:jorik041,项目名称:opencvsharp,代码行数:17,代码来源:Cv2_imgproc.cs


示例11: FastNlMeansDenoising

 /// <summary>
 /// Perform image denoising using Non-local Means Denoising algorithm 
 /// with several computational optimizations. Noise expected to be a gaussian white noise
 /// </summary>
 /// <param name="src">Input 8-bit 1-channel, 2-channel or 3-channel image.</param>
 /// <param name="dst">Output image with the same size and type as src .</param>
 /// <param name="h">
 /// Parameter regulating filter strength. Big h value perfectly removes noise but also removes image details, 
 /// smaller h value preserves details but also preserves some noise</param>
 /// <param name="templateWindowSize">
 /// Size in pixels of the template patch that is used to compute weights. Should be odd. Recommended value 7 pixels</param>
 /// <param name="searchWindowSize">
 /// Size in pixels of the window that is used to compute weighted average for given pixel. 
 /// Should be odd. Affect performance linearly: greater searchWindowsSize - greater denoising time. Recommended value 21 pixels</param>
 public static void FastNlMeansDenoising(InputArray src, OutputArray dst, float h = 3,
     int templateWindowSize = 7, int searchWindowSize = 21)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     if (dst == null)
         throw new ArgumentNullException("dst");
     src.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     NativeMethods.photo_fastNlMeansDenoising(src.CvPtr, dst.CvPtr, h, templateWindowSize, searchWindowSize);
     dst.Fix();
 }
开发者ID:JiphuTzu,项目名称:opencvsharp,代码行数:26,代码来源:Cv2_photo.cs


示例12: CopyMakeBorder

 /// <summary>
 /// Forms a border around the image
 /// </summary>
 /// <param name="src">The source image</param>
 /// <param name="dst">The destination image; will have the same type as src and 
 /// the size Size(src.cols+left+right, src.rows+top+bottom)</param>
 /// <param name="top">Specify how much pixels in each direction from the source image rectangle one needs to extrapolate</param>
 /// <param name="bottom">Specify how much pixels in each direction from the source image rectangle one needs to extrapolate</param>
 /// <param name="left">Specify how much pixels in each direction from the source image rectangle one needs to extrapolate</param>
 /// <param name="right">Specify how much pixels in each direction from the source image rectangle one needs to extrapolate</param>
 /// <param name="borderType">The border type</param>
 /// <param name="value">The border value if borderType == Constant</param>
 public static void CopyMakeBorder(InputArray src, OutputArray dst, int top, int bottom, int left, int right, BorderType borderType, Scalar? value = null)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     if (dst == null)
         throw new ArgumentNullException("dst");
     src.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     Scalar value0 = value.GetValueOrDefault(new Scalar());
     NativeMethods.imgproc_copyMakeBorder(src.CvPtr, dst.CvPtr, top, bottom, left, right, (int)borderType, value0);
     dst.Fix();
 }
开发者ID:josephgodwinkimani,项目名称:opencvsharp,代码行数:24,代码来源:Cv2_imgproc.cs


示例13: FAST

        /// <summary>
        /// Detects corners using the FAST algorithm
        /// </summary>
        /// <param name="image">grayscale image where keypoints (corners) are detected.</param>
        /// <param name="threshold">threshold on difference between intensity of the central pixel 
        /// and pixels of a circle around this pixel.</param>
        /// <param name="nonmaxSupression">if true, non-maximum suppression is applied to 
        /// detected corners (keypoints).</param>
        /// <param name="type">one of the three neighborhoods as defined in the paper</param>
        /// <returns>keypoints detected on the image.</returns>
        public static KeyPoint[] FAST(InputArray image, int threshold, bool nonmaxSupression, FASTType type)
        {
            if (image == null)
                throw new ArgumentNullException(nameof(image));
            image.ThrowIfDisposed();

            using (var kp = new VectorOfKeyPoint())
            {
                NativeMethods.features2d_FAST2(image.CvPtr, kp.CvPtr, threshold, nonmaxSupression ? 1 : 0, (int)type);
                GC.KeepAlive(image);
                return kp.ToArray();
            }
        }
开发者ID:shimat,项目名称:opencvsharp,代码行数:23,代码来源:Cv2_features2d.cs


示例14: Rodrigues

 /// <summary>
 /// converts rotation vector to rotation matrix or vice versa using Rodrigues transformation
 /// </summary>
 /// <param name="src">Input rotation vector (3x1 or 1x3) or rotation matrix (3x3).</param>
 /// <param name="dst">Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively.</param>
 /// <param name="jacobian">Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial derivatives of the output array components with respect to the input array components.</param>
 public static void Rodrigues(InputArray src, OutputArray dst, OutputArray jacobian = null)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     if (dst == null)
         throw new ArgumentNullException("dst");
     src.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     NativeMethods.calib3d_Rodrigues(src.CvPtr, dst.CvPtr, ToPtr(jacobian));
     dst.Fix();
     if (jacobian != null)
         jacobian.Fix();
 }
开发者ID:kaorun55,项目名称:opencvsharp,代码行数:19,代码来源:Cv2_calib3d.cs


示例15: AGAST

 /// <summary>
 /// Detects corners using the AGAST algorithm
 /// </summary>
 /// <param name="image">grayscale image where keypoints (corners) are detected.</param>
 /// <param name="threshold">threshold on difference between intensity of the central pixel 
 /// and pixels of a circle around this pixel.</param>
 /// <param name="nonmaxSuppression">if true, non-maximum suppression is applied to 
 /// detected corners (keypoints).</param>
 /// <param name="type">one of the four neighborhoods as defined in the paper</param>
 /// <returns>keypoints detected on the image.</returns>
 public static KeyPoint[] AGAST(InputArray image, int threshold, bool nonmaxSuppression, AGASTType type)
 {
     if (image == null)
         throw new ArgumentNullException("image");
     image.ThrowIfDisposed();
     
     using (var vector = new VectorOfKeyPoint())
     {
         NativeMethods.features2d_AGAST(image.CvPtr, vector.CvPtr, threshold, nonmaxSuppression ? 1 : 0,
             (int) type);
         GC.KeepAlive(image);
         return vector.ToArray();
     }
 }
开发者ID:CodeSang,项目名称:opencvsharp,代码行数:24,代码来源:Cv2_features2d.cs


示例16: UpdateMotionHistory

 /// <summary>
 /// Updates motion history image using the current silhouette
 /// </summary>
 /// <param name="silhouette">Silhouette mask that has non-zero pixels where the motion occurs.</param>
 /// <param name="mhi">Motion history image that is updated by the function (single-channel, 32-bit floating-point).</param>
 /// <param name="timestamp">Current time in milliseconds or other units.</param>
 /// <param name="duration">Maximal duration of the motion track in the same units as timestamp .</param>
 public static void UpdateMotionHistory(
     InputArray silhouette, InputOutputArray mhi,
     double timestamp, double duration)
 {
     if (silhouette == null)
         throw new ArgumentNullException("silhouette");
     if (mhi == null)
         throw new ArgumentNullException("mhi");
     silhouette.ThrowIfDisposed();
     mhi.ThrowIfNotReady();
     NativeMethods.video_updateMotionHistory(
         silhouette.CvPtr, mhi.CvPtr, timestamp, duration);
     mhi.Fix();
 }
开发者ID:healtech,项目名称:opencvsharp,代码行数:21,代码来源:Cv2_video.cs


示例17: Apply

 /// <summary>
 /// the update operator that takes the next video frame and returns the current foreground mask as 8-bit binary image.
 /// </summary>
 /// <param name="image"></param>
 /// <param name="fgmask"></param>
 /// <param name="learningRate"></param>
 public virtual void Apply(InputArray image, OutputArray fgmask, double learningRate = -1)
 {
     if (image == null)
         throw new ArgumentNullException("image");
     if (fgmask == null)
         throw new ArgumentNullException("fgmask");
     image.ThrowIfDisposed();
     fgmask.ThrowIfNotReady();
     
     NativeMethods.video_BackgroundSubtractor_apply(ptr, image.CvPtr, fgmask.CvPtr, learningRate);
     
     fgmask.Fix();
     GC.KeepAlive(image);
 }
开发者ID:JiphuTzu,项目名称:opencvsharp,代码行数:20,代码来源:BackgroundSubtractor.cs


示例18: Inpaint

 /// <summary>
 /// restores the damaged image areas using one of the available intpainting algorithms
 /// </summary>
 /// <param name="src"></param>
 /// <param name="inpaintMask"></param>
 /// <param name="dst"></param>
 /// <param name="inpaintRadius"></param>
 /// <param name="flags"></param>
 public static void Inpaint(InputArray src, InputArray inpaintMask,
     OutputArray dst, double inpaintRadius, InpaintMethod flags)
 {
     if (src == null)
         throw new ArgumentNullException("src");
     if (inpaintMask == null)
         throw new ArgumentNullException("inpaintMask");
     if (dst == null)
         throw new ArgumentNullException("dst");
     src.ThrowIfDisposed();
     inpaintMask.ThrowIfDisposed();
     dst.ThrowIfNotReady();
     NativeMethods.photo_inpaint(src.CvPtr, inpaintMask.CvPtr, dst.CvPtr, inpaintRadius, (int)flags);
     dst.Fix();
 }
开发者ID:JiphuTzu,项目名称:opencvsharp,代码行数:23,代码来源:Cv2_photo.cs


示例19: CalcGlobalOrientation

        /// <summary>
        /// Computes the global orientation of the selected motion history image part
        /// </summary>
        /// <param name="orientation">Motion gradient orientation image calculated by the function CalcMotionGradient() .</param>
        /// <param name="mask">Mask image. It may be a conjunction of a valid gradient mask, also calculated by CalcMotionGradient() ,
        /// and the mask of a region whose direction needs to be calculated.</param>
        /// <param name="mhi">Motion history image calculated by UpdateMotionHistory() .</param>
        /// <param name="timestamp">Timestamp passed to UpdateMotionHistory() .</param>
        /// <param name="duration">Maximum duration of a motion track in milliseconds, passed to UpdateMotionHistory() .</param>
        /// <returns></returns>
        public static double CalcGlobalOrientation(
            InputArray orientation, InputArray mask, InputArray mhi,
            double timestamp, double duration)
        {
            if (orientation == null)
                throw new ArgumentNullException("orientation");
            if (mask == null)
                throw new ArgumentNullException("mask");
            if (mhi == null)
                throw new ArgumentNullException("mhi");
            orientation.ThrowIfDisposed();
            mask.ThrowIfDisposed();
            mhi.ThrowIfDisposed();

            return NativeMethods.video_calcGlobalOrientation(
                orientation.CvPtr, mask.CvPtr, mhi.CvPtr, timestamp, duration);
        }
开发者ID:healtech,项目名称:opencvsharp,代码行数:27,代码来源:Cv2_video.cs


示例20: CalcGlobalOrientation

        /// <summary>
        /// Computes the global orientation of the selected motion history image part
        /// </summary>
        /// <param name="orientation">Motion gradient orientation image calculated by the function CalcMotionGradient() .</param>
        /// <param name="mask">Mask image. It may be a conjunction of a valid gradient mask, also calculated by CalcMotionGradient() ,
        /// and the mask of a region whose direction needs to be calculated.</param>
        /// <param name="mhi">Motion history image calculated by UpdateMotionHistory() .</param>
        /// <param name="timestamp">Timestamp passed to UpdateMotionHistory() .</param>
        /// <param name="duration">Maximum duration of a motion track in milliseconds, passed to UpdateMotionHistory() .</param>
        /// <returns></returns>
        public static double CalcGlobalOrientation(
            InputArray orientation, InputArray mask, InputArray mhi,
            double timestamp, double duration)
        {
            if (orientation == null)
                throw new ArgumentNullException(nameof(orientation));
            if (mask == null)
                throw new ArgumentNullException(nameof(mask));
            if (mhi == null)
                throw new ArgumentNullException(nameof(mhi));
            orientation.ThrowIfDisposed();
            mask.ThrowIfDisposed();
            mhi.ThrowIfDisposed();

            return NativeMethods.optflow_motempl_calcGlobalOrientation(
                orientation.CvPtr, mask.CvPtr, mhi.CvPtr, timestamp, duration);
        }
开发者ID:shimat,项目名称:opencvsharp,代码行数:27,代码来源:Cv2_optflow.cs



注:本文中的InputArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# InputBox类代码示例发布时间:2022-05-24
下一篇:
C# InputAction类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap