本文整理汇总了C#中OutputArray类的典型用法代码示例。如果您正苦于以下问题:C# OutputArray类的具体用法?C# OutputArray怎么用?C# OutputArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OutputArray类属于命名空间,在下文中一共展示了OutputArray类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetBackgroundImage
/// <summary>
/// computes a background image
/// </summary>
/// <param name="backgroundImage"></param>
public virtual void GetBackgroundImage(OutputArray backgroundImage)
{
if (backgroundImage == null)
throw new ArgumentNullException("backgroundImage");
backgroundImage.ThrowIfNotReady();
NativeMethods.video_BackgroundSubtractor_getBackgroundImage(ptr, backgroundImage.CvPtr);
backgroundImage.Fix();
}
开发者ID:JiphuTzu,项目名称:opencvsharp,代码行数:14,代码来源:BackgroundSubtractor.cs
示例2: NextFrame
/// <summary>
/// Process next frame from input and return output result.
/// </summary>
/// <param name="frame">Output result</param>
public virtual void NextFrame(OutputArray frame)
{
if (firstCall)
{
InitImpl(frameSource);
firstCall = false;
}
ProcessImpl(frameSource, frame);
}
开发者ID:CodeSang,项目名称:opencvsharp,代码行数:14,代码来源:SuperResolution.cs
示例3: 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
示例4: 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
示例5: 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
示例6: 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
示例7: 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
示例8: 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
示例9: 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
示例10: GetDerivKernels
/// <summary>
/// Returns filter coefficients for computing spatial image derivatives.
/// </summary>
/// <param name="kx">Output matrix of row filter coefficients. It has the type ktype.</param>
/// <param name="ky">Output matrix of column filter coefficients. It has the type ktype.</param>
/// <param name="dx">Derivative order in respect of x.</param>
/// <param name="dy">Derivative order in respect of y.</param>
/// <param name="ksize">Aperture size. It can be CV_SCHARR, 1, 3, 5, or 7.</param>
/// <param name="normalize">Flag indicating whether to normalize (scale down) the filter coefficients or not.
/// Theoretically, the coefficients should have the denominator \f$=2^{ksize*2-dx-dy-2}\f$.
/// If you are going to filter floating-point images, you are likely to use the normalized kernels.
/// But if you compute derivatives of an 8-bit image, store the results in a 16-bit image,
/// and wish to preserve all the fractional bits, you may want to set normalize = false.</param>
/// <param name="ktype">Type of filter coefficients. It can be CV_32f or CV_64F.</param>
public static void GetDerivKernels(
OutputArray kx, OutputArray ky, int dx, int dy, int ksize,
bool normalize = false, MatType? ktype = null)
{
if (kx == null)
throw new ArgumentNullException(nameof(kx));
if (ky == null)
throw new ArgumentNullException(nameof(ky));
kx.ThrowIfNotReady();
ky.ThrowIfNotReady();
var ktype0 = ktype.GetValueOrDefault(MatType.CV_32F);
NativeMethods.imgproc_getDerivKernels(
kx.CvPtr, ky.CvPtr, dx, dy, ksize, normalize ? 1 : 0, ktype0);
kx.Fix();
ky.Fix();
}
开发者ID:shimat,项目名称:opencvsharp,代码行数:32,代码来源:Cv2_imgproc.cs
示例11: Process
/// <summary>
/// Recovers inverse camera response.
/// </summary>
/// <param name="src">vector of input images</param>
/// <param name="dst">256x1 matrix with inverse camera response function</param>
/// <param name="times">vector of exposure time values for each image</param>
public virtual void Process(IEnumerable<Mat> src, OutputArray dst, IEnumerable<float> times)
{
if (src == null)
throw new ArgumentNullException("src");
if (dst == null)
throw new ArgumentNullException("dst");
if (times == null)
throw new ArgumentNullException("times");
dst.ThrowIfNotReady();
IntPtr[] srcArray = EnumerableEx.SelectPtrs(src);
float[] timesArray = EnumerableEx.ToArray(times);
if (srcArray.Length != timesArray.Length)
throw new OpenCvSharpException("src.Count() != times.Count");
NativeMethods.photo_CalibrateCRF_process(ptr, srcArray, srcArray.Length, dst.CvPtr, timesArray);
dst.Fix();
GC.KeepAlive(src);
}
开发者ID:CodeSang,项目名称:opencvsharp,代码行数:26,代码来源:CalibrateCRF.cs
示例12: CalcMotionGradient
/// <summary>
/// Computes the motion gradient orientation image from the motion history image
/// </summary>
/// <param name="mhi">Motion history single-channel floating-point image.</param>
/// <param name="mask">Output mask image that has the type CV_8UC1 and the same size as mhi.
/// Its non-zero elements mark pixels where the motion gradient data is correct.</param>
/// <param name="orientation">Output motion gradient orientation image that has the same type and the same size as mhi.
/// Each pixel of the image is a motion orientation, from 0 to 360 degrees.</param>
/// <param name="delta1">Minimal (or maximal) allowed difference between mhi values within a pixel neighborhood.</param>
/// <param name="delta2">Maximal (or minimal) allowed difference between mhi values within a pixel neighborhood.
/// That is, the function finds the minimum ( m(x,y) ) and maximum ( M(x,y) ) mhi values over 3x3 neighborhood of each pixel
/// and marks the motion orientation at (x, y) as valid only if:
/// min(delta1, delta2) <= M(x,y)-m(x,y) <= max(delta1, delta2).</param>
/// <param name="apertureSize"></param>
public static void CalcMotionGradient(
InputArray mhi, OutputArray mask, OutputArray orientation,
double delta1, double delta2, int apertureSize = 3)
{
if (mhi == null)
throw new ArgumentNullException("mhi");
if (mask == null)
throw new ArgumentNullException("mask");
if (orientation == null)
throw new ArgumentNullException("orientation");
mhi.ThrowIfDisposed();
mask.ThrowIfNotReady();
orientation.ThrowIfNotReady();
NativeMethods.video_calcMotionGradient(
mhi.CvPtr, mask.CvPtr, orientation.CvPtr, delta1, delta2, apertureSize);
mask.Fix();
orientation.Fix();
}
开发者ID:healtech,项目名称:opencvsharp,代码行数:34,代码来源:Cv2_video.cs
示例13: BuildOpticalFlowPyramid
/// <summary>
/// Constructs a pyramid which can be used as input for calcOpticalFlowPyrLK
/// </summary>
/// <param name="img">8-bit input image.</param>
/// <param name="pyramid">output pyramid.</param>
/// <param name="winSize">window size of optical flow algorithm.
/// Must be not less than winSize argument of calcOpticalFlowPyrLK().
/// It is needed to calculate required padding for pyramid levels.</param>
/// <param name="maxLevel">0-based maximal pyramid level number.</param>
/// <param name="withDerivatives">set to precompute gradients for the every pyramid level.
/// If pyramid is constructed without the gradients then calcOpticalFlowPyrLK() will
/// calculate them internally.</param>
/// <param name="pyrBorder">the border mode for pyramid layers.</param>
/// <param name="derivBorder">the border mode for gradients.</param>
/// <param name="tryReuseInputImage">put ROI of input image into the pyramid if possible.
/// You can pass false to force data copying.</param>
/// <returns>number of levels in constructed pyramid. Can be less than maxLevel.</returns>
public static int BuildOpticalFlowPyramid(
InputArray img, OutputArray pyramid,
Size winSize, int maxLevel,
bool withDerivatives = true,
BorderTypes pyrBorder = BorderTypes.Reflect101,
BorderTypes derivBorder = BorderTypes.Constant,
bool tryReuseInputImage = true)
{
if (img == null)
throw new ArgumentNullException("img");
if (pyramid == null)
throw new ArgumentNullException("pyramid");
img.ThrowIfDisposed();
pyramid.ThrowIfNotReady();
int result = NativeMethods.video_buildOpticalFlowPyramid1(
img.CvPtr, pyramid.CvPtr, winSize, maxLevel, withDerivatives ? 1 : 0,
(int)pyrBorder, (int)derivBorder, tryReuseInputImage ? 1 : 0);
pyramid.Fix();
return result;
}
开发者ID:CodeSang,项目名称:opencvsharp,代码行数:38,代码来源:Cv2_video.cs
示例14: MeanStdDev
/// <summary>
/// computes mean value and standard deviation of all or selected array elements
/// </summary>
/// <param name="src">The source array; it should have 1 to 4 channels
/// (so that the results can be stored in Scalar's)</param>
/// <param name="mean">The output parameter: computed mean value</param>
/// <param name="stddev">The output parameter: computed standard deviation</param>
/// <param name="mask">The optional operation mask</param>
public static void MeanStdDev(
InputArray src, OutputArray mean, OutputArray stddev, InputArray mask = null)
{
if (src == null)
throw new ArgumentNullException("src");
if (mean == null)
throw new ArgumentNullException("mean");
if (stddev == null)
throw new ArgumentNullException("stddev");
src.ThrowIfDisposed();
mean.ThrowIfNotReady();
stddev.ThrowIfNotReady();
NativeMethods.core_meanStdDev_OutputArray(src.CvPtr, mean.CvPtr, stddev.CvPtr, ToPtr(mask));
mean.Fix();
stddev.Fix();
GC.KeepAlive(src);
GC.KeepAlive(mask);
}
开发者ID:fdncred,项目名称:opencvsharp,代码行数:28,代码来源:Cv2_core.cs
示例15: FindNonZero
/// <summary>
/// returns the list of locations of non-zero pixels
/// </summary>
/// <param name="src"></param>
/// <param name="idx"></param>
public static void FindNonZero(InputArray src, OutputArray idx)
{
if (src == null)
throw new ArgumentNullException("src");
if (idx == null)
throw new ArgumentNullException("idx");
src.ThrowIfDisposed();
idx.ThrowIfNotReady();
NativeMethods.core_findNonZero(src.CvPtr, idx.CvPtr);
GC.KeepAlive(src);
idx.Fix();
}
开发者ID:fdncred,项目名称:opencvsharp,代码行数:17,代码来源:Cv2_core.cs
示例16: LUT
/// <summary>
/// transforms array of numbers using a lookup table: dst(i)=lut(src(i))
/// </summary>
/// <param name="src">Source array of 8-bit elements</param>
/// <param name="lut">Look-up table of 256 elements.
/// In the case of multi-channel source array, the table should either have
/// a single channel (in this case the same table is used for all channels)
/// or the same number of channels as in the source array</param>
/// <param name="dst">Destination array;
/// will have the same size and the same number of channels as src,
/// and the same depth as lut</param>
/// <param name="interpolation"></param>
public static void LUT(InputArray src, byte[] lut, OutputArray dst, int interpolation = 0)
{
if (lut == null)
throw new ArgumentNullException("lut");
if (lut.Length != 256)
throw new ArgumentException("lut.Length != 256");
using (Mat lutMat = new Mat(256, 1, MatType.CV_8UC1, lut))
{
LUT(src, lutMat, dst, interpolation);
}
}
开发者ID:fdncred,项目名称:opencvsharp,代码行数:23,代码来源:Cv2_core.cs
示例17: ConvertScaleAbs
/// <summary>
/// スケーリング後,絶対値を計算し,結果を結果を 8 ビットに変換します.
/// </summary>
/// <param name="src">入力配列</param>
/// <param name="dst">出力配列</param>
/// <param name="alpha">オプションのスケールファクタ. [既定値は1]</param>
/// <param name="beta">スケーリングされた値に加えられるオプション値. [既定値は0]</param>
#else
/// <summary>
/// Scales, computes absolute values and converts the result to 8-bit.
/// </summary>
/// <param name="src">The source array</param>
/// <param name="dst">The destination array</param>
/// <param name="alpha">The optional scale factor. [By default this is 1]</param>
/// <param name="beta">The optional delta added to the scaled values. [By default this is 0]</param>
#endif
public static void ConvertScaleAbs(InputArray src, OutputArray dst, double alpha = 1, double beta = 0)
{
if (src == null)
throw new ArgumentNullException("src");
if (dst == null)
throw new ArgumentNullException("dst");
src.ThrowIfDisposed();
dst.ThrowIfNotReady();
NativeMethods.core_convertScaleAbs(src.CvPtr, dst.CvPtr, alpha, beta);
GC.KeepAlive(src);
dst.Fix();
}
开发者ID:fdncred,项目名称:opencvsharp,代码行数:28,代码来源:Cv2_core.cs
示例18: ExtractChannel
/// <summary>
/// extracts a single channel from src (coi is 0-based index)
/// </summary>
/// <param name="src"></param>
/// <param name="dst"></param>
/// <param name="coi"></param>
public static void ExtractChannel(InputArray src, OutputArray dst, int coi)
{
if (src == null)
throw new ArgumentNullException("src");
if (dst == null)
throw new ArgumentNullException("dst");
src.ThrowIfDisposed();
dst.ThrowIfNotReady();
NativeMethods.core_extractChannel(src.CvPtr, dst.CvPtr, coi);
GC.KeepAlive(src);
dst.Fix();
}
开发者ID:fdncred,项目名称:opencvsharp,代码行数:18,代码来源:Cv2_core.cs
示例19: Divide
/// <summary>
/// 2つの配列同士,あるいは配列とスカラの 要素毎の商を求めます.
/// </summary>
/// <param name="scale">スケールファクタ</param>
/// <param name="src2">1番目の入力配列</param>
/// <param name="dst">src2 と同じサイズ,同じ型である出力配列</param>
/// <param name="dtype"></param>
#else
/// <summary>
/// Performs per-element division of two arrays or a scalar by an array.
/// </summary>
/// <param name="scale">Scale factor</param>
/// <param name="src2">The first source array</param>
/// <param name="dst">The destination array; will have the same size and same type as src2</param>
/// <param name="dtype"></param>
#endif
public static void Divide(double scale, InputArray src2, OutputArray dst, int dtype = -1)
{
if (src2 == null)
throw new ArgumentNullException("src2");
if (dst == null)
throw new ArgumentNullException("dst");
src2.ThrowIfDisposed();
dst.ThrowIfNotReady();
NativeMethods.core_divide(scale, src2.CvPtr, dst.CvPtr, dtype);
GC.KeepAlive(src2);
dst.Fix();
}
开发者ID:fdncred,项目名称:opencvsharp,代码行数:28,代码来源:Cv2_core.cs
示例20: MulSpectrums
/// <summary>
/// computes element-wise product of the two Fourier spectrums. The second spectrum can optionally be conjugated before the multiplication
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <param name="c"></param>
/// <param name="flags"></param>
/// <param name="conjB"></param>
public static void MulSpectrums(
InputArray a, InputArray b, OutputArray c,
DftFlags flags, bool conjB = false)
{
if (a == null)
throw new ArgumentNullException("a");
if (b == null)
throw new ArgumentNullException("b");
if (c == null)
throw new ArgumentNullException("c");
a.ThrowIfDisposed();
b.ThrowIfDisposed();
c.ThrowIfNotReady();
NativeMethods.core_mulSpectrums(a.CvPtr, b.CvPtr, c.CvPtr, (int)flags, conjB ? 1 : 0);
GC.KeepAlive(a);
GC.KeepAlive(b);
c.Fix();
}
开发者ID:fdncred,项目名称:opencvsharp,代码行数:26,代码来源:Cv2_core.cs
注:本文中的OutputArray类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论