mirror of https://github.com/emgucv/emgucv.git
Browse Source
Added CudaColumnSumFilter, CudaDerivFilter, CudaMedianFilter, CudaRowSumFilter, CudaScharrFilter, CudaSeparableLinearFilter.
pull/84/head
Added CudaColumnSumFilter, CudaDerivFilter, CudaMedianFilter, CudaRowSumFilter, CudaScharrFilter, CudaSeparableLinearFilter.
pull/84/head

11 changed files with 303 additions and 20 deletions
-
4Emgu.CV.Contrib/BgSegm/BackgroundSubtractorCNT.cs
-
2Emgu.CV.Cuda/Bgsegm/CudaBackgroundSubtractorMOG2.cs
-
35Emgu.CV.Cuda/Filters/CudaColumnSumFilter.cs
-
45Emgu.CV.Cuda/Filters/CudaDerivFilter.cs
-
17Emgu.CV.Cuda/Filters/CudaFilter.cs
-
32Emgu.CV.Cuda/Filters/CudaMedianFilter.cs
-
31Emgu.CV.Cuda/Filters/CudaRowSumFilter.cs
-
43Emgu.CV.Cuda/Filters/CudaScharrFilter.cs
-
47Emgu.CV.Cuda/Filters/CudaSeparableLinearFilter.cs
-
48Emgu.CV.Extern/cudafilters/cudafilters_c.cpp
-
19Emgu.CV.Extern/cudafilters/cudafilters_c.h
@ -0,0 +1,35 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using System.Drawing; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Features2D; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.Util; |
|||
|
|||
namespace Emgu.CV.Cuda |
|||
{ |
|||
public class ColumnSumFilter : CudaFilter |
|||
{ |
|||
public ColumnSumFilter( |
|||
DepthType srcDepth, int srcChannels, |
|||
DepthType dstDepth, int dstChannels, |
|||
int ksize, int anchor, |
|||
CvEnum.BorderType borderType = BorderType.Default, MCvScalar borderValue = new MCvScalar()) |
|||
{ |
|||
_ptr = CudaInvoke.cudaCreateColumnSumFilter(CvInvoke.MakeType(srcDepth, srcChannels), CvInvoke.MakeType(dstDepth, dstChannels), ksize, anchor, borderType, ref borderValue); |
|||
} |
|||
} |
|||
|
|||
public static partial class CudaInvoke |
|||
{ |
|||
[DllImport(CvInvoke.ExternCudaLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal static extern IntPtr cudaCreateColumnSumFilter(int srcType, int dstType, int ksize, int anchor, CvEnum.BorderType borderMode, ref MCvScalar borderVal); |
|||
} |
|||
} |
@ -0,0 +1,45 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using System.Drawing; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Features2D; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.Util; |
|||
|
|||
namespace Emgu.CV.Cuda |
|||
{ |
|||
|
|||
public class CudaDerivFilter : CudaFilter |
|||
{ |
|||
|
|||
public CudaDerivFilter( |
|||
DepthType srcDepth, int srcChannels, DepthType dstDepth, int dstChannels, |
|||
int dx, int dy, |
|||
int ksize, bool normalize, double scale, |
|||
CvEnum.BorderType rowBorderType = BorderType.Default, |
|||
CvEnum.BorderType columnBorderType = BorderType.Default) |
|||
{ |
|||
_ptr = CudaInvoke.cudaCreateDerivFilter(CvInvoke.MakeType(srcDepth, srcChannels), CvInvoke.MakeType(dstDepth, dstChannels), dx, dy, ksize, normalize, scale, rowBorderType, columnBorderType); |
|||
} |
|||
} |
|||
|
|||
public static partial class CudaInvoke |
|||
{ |
|||
[DllImport(CvInvoke.ExternCudaLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal static extern IntPtr cudaCreateDerivFilter( |
|||
int srcType, int dstType, |
|||
int dx, int dy, |
|||
int ksize, |
|||
[MarshalAs(CvInvoke.BoolMarshalType)] |
|||
bool normalize, |
|||
double scale, |
|||
CvEnum.BorderType rowBorderMode, CvEnum.BorderType columnBorderMode); |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using System.Drawing; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Features2D; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.Util; |
|||
|
|||
namespace Emgu.CV.Cuda |
|||
{ |
|||
|
|||
public class MedianFilter : CudaFilter |
|||
{ |
|||
public MedianFilter(DepthType srcDepth, int srcChannels, int windowSize, int partition) |
|||
{ |
|||
_ptr = CudaInvoke.cudaCreateMedianFilter(CvInvoke.MakeType(srcDepth, srcChannels), windowSize, partition); |
|||
} |
|||
} |
|||
|
|||
public static partial class CudaInvoke |
|||
{ |
|||
[DllImport(CvInvoke.ExternCudaLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal static extern IntPtr cudaCreateMedianFilter(int srcType, int windowSize, int partition); |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using System.Drawing; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Features2D; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.Util; |
|||
|
|||
namespace Emgu.CV.Cuda |
|||
{ |
|||
public class RowSumFilter : CudaFilter |
|||
{ |
|||
public RowSumFilter(DepthType srcDepth, int srcChannels, DepthType dstDepth, int dstChannels, int ksize, int anchor, CvEnum.BorderType borderType = BorderType.Default, MCvScalar borderValue = new MCvScalar()) |
|||
{ |
|||
_ptr = CudaInvoke.cudaCreateRowSumFilter(CvInvoke.MakeType(srcDepth, srcChannels), CvInvoke.MakeType(dstDepth, dstChannels), ksize, anchor, borderType, ref borderValue); |
|||
} |
|||
} |
|||
|
|||
public static partial class CudaInvoke |
|||
{ |
|||
[DllImport(CvInvoke.ExternCudaLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal static extern IntPtr cudaCreateRowSumFilter(int srcType, int dstType, int ksize, int anchor, CvEnum.BorderType borderMode, ref MCvScalar borderVal); |
|||
} |
|||
} |
@ -0,0 +1,43 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using System.Drawing; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Features2D; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.Util; |
|||
|
|||
namespace Emgu.CV.Cuda |
|||
{ |
|||
|
|||
public class ScharrFilter : CudaFilter |
|||
{ |
|||
public ScharrFilter( |
|||
DepthType srcDepth, int srcChannels, |
|||
DepthType dstDepth, int dstChannels, |
|||
int dx, int dy, |
|||
double scale, |
|||
CvEnum.BorderType rowBorderMode = BorderType.Default, |
|||
CvEnum.BorderType columnBorderMode = BorderType.Default) |
|||
{ |
|||
_ptr = CudaInvoke.cudaCreateScharrFilter( |
|||
CvInvoke.MakeType(srcDepth, srcChannels), CvInvoke.MakeType(dstDepth, dstChannels), |
|||
dx, dy, scale, rowBorderMode, columnBorderMode); |
|||
} |
|||
} |
|||
|
|||
public static partial class CudaInvoke |
|||
{ |
|||
[DllImport(CvInvoke.ExternCudaLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal static extern IntPtr cudaCreateScharrFilter( |
|||
int srcType, int dstType, int dx, int dy, |
|||
double scale, |
|||
CvEnum.BorderType rowBorderMode, CvEnum.BorderType columnBorderMode); |
|||
} |
|||
} |
@ -0,0 +1,47 @@ |
|||
//----------------------------------------------------------------------------
|
|||
// Copyright (C) 2004-2017 by EMGU Corporation. All rights reserved.
|
|||
//----------------------------------------------------------------------------
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Runtime.InteropServices; |
|||
using System.Text; |
|||
using System.Drawing; |
|||
using Emgu.CV.CvEnum; |
|||
using Emgu.CV.Features2D; |
|||
using Emgu.CV.Structure; |
|||
using Emgu.CV.Util; |
|||
using Emgu.CV; |
|||
using Emgu.Util; |
|||
|
|||
namespace Emgu.CV.Cuda |
|||
{ |
|||
/// <summary>
|
|||
/// SeparableLinearFilter
|
|||
/// </summary>
|
|||
public class SeparableLinearFilter : CudaFilter |
|||
{ |
|||
|
|||
public SeparableLinearFilter( |
|||
DepthType srcDepth, int srcChannels, |
|||
DepthType dstDepth, int dstChannels, |
|||
IInputArray rowKernel, |
|||
IInputArray columnKernel, |
|||
Point anchor, |
|||
CvEnum.BorderType rowBorderType = BorderType.Default, |
|||
CvEnum.BorderType columnBorderType = BorderType.Default) |
|||
{ |
|||
using (InputArray iaRowKernel = rowKernel.GetInputArray()) |
|||
using (InputArray iaColumnKernel = columnKernel.GetInputArray()) |
|||
_ptr = CudaInvoke.cudaCreateSeparableLinearFilter(CvInvoke.MakeType(srcDepth, srcChannels), CvInvoke.MakeType(dstDepth, dstChannels), iaRowKernel, iaColumnKernel, ref anchor, rowBorderType, columnBorderType); |
|||
} |
|||
} |
|||
|
|||
public static partial class CudaInvoke |
|||
{ |
|||
[DllImport(CvInvoke.ExternCudaLibrary, CallingConvention = CvInvoke.CvCallingConvention)] |
|||
internal static extern IntPtr cudaCreateSeparableLinearFilter( |
|||
int srcType, int dstType, IntPtr rowKernel, IntPtr columnKernel, |
|||
ref Point anchor, CvEnum.BorderType rowBorderMode, CvEnum.BorderType columnBorderMode); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue