本文整理汇总了C#中DoubleImage类的典型用法代码示例。如果您正苦于以下问题:C# DoubleImage类的具体用法?C# DoubleImage怎么用?C# DoubleImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoubleImage类属于命名空间,在下文中一共展示了DoubleImage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalcEigenObjects
/// <summary>
/// Calculates eigen objects
/// </summary>
public static void CalcEigenObjects(Bitmap[] input, int maxIteration, double eps, DoubleImage[] eigVecs, double[] eigVals, DoubleImage avg)
{
if (input.Length == 0)
return;
int nObjects = input.Length;
int nEigens = nObjects - 1;
byte[][] objs = new byte[nObjects][];
double[][] eigs = new double[nEigens][];
int obj_step = 0, old_step = 0;
int eig_step = 0, oldeig_step = 0;
Size obj_size = avg.Size, old_size = avg.Size, oldeig_size = avg.Size;
for (var i = 0; i < nObjects; i++)
{
Bitmap obj = input[i];
objs[i] = obj.CopyGrayscaleBitmapToByteArray(out obj_step);
obj_size = obj.Size;
if (obj_size != avg.Size || obj_size != old_size)
throw new EigenObjectException("Different sizes of objects");
if (i > 0 && obj_step != old_step)
throw new EigenObjectException("Different steps of objects");
old_step = obj_step;
old_size = obj_size;
}
for (var i = 0; i < nEigens; i++)
{
DoubleImage eig = eigVecs[i];
eig_step = eig.Step;
eigs[i] = eig.Data;
if (eig.Size != avg.Size || eig.Size != oldeig_size)
throw new EigenObjectException("Different sizes of objects");
if (i > 0 && eig_step != oldeig_step)
throw new EigenObjectException("Different steps of objects");
oldeig_step = eig.Step;
oldeig_size = eig.Size;
}
CalcEigenObjects(nObjects, objs, obj_step,
eigs, eig_step, obj_size,
maxIteration, eps, avg.Data, avg.Step, eigVals);
}
示例2: CalcEigenObjects
/// <summary>
/// Caculate the eigen images for the specific traning image
/// </summary>
public static void CalcEigenObjects(Bitmap[] trainingImages, int maxIter, double eps, out DoubleImage[] eigenImages, out DoubleImage avg)
{
int width = trainingImages[0].Width;
int height = trainingImages[0].Height;
if (maxIter <= 0 || maxIter > trainingImages.Length)
maxIter = trainingImages.Length;
int maxEigenObjs = maxIter;
eigenImages = new DoubleImage[maxEigenObjs];
for (int i = 0; i < eigenImages.Length; i++)
eigenImages[i] = new DoubleImage(width, height);
avg = new DoubleImage(width, height);
EigenObjects.CalcEigenObjects(trainingImages, maxIter, eps, eigenImages, null, avg);
}
示例3: ClassifyOutputTab
public double ClassifyOutputTab(DoubleImage image, vector_ClassOutput outputTab) {
double ret = VisionLabPINVOKE.BPN_ImageClassifier_Double_ClassifyOutputTab(swigCPtr, DoubleImage.getCPtr(image), vector_ClassOutput.getCPtr(outputTab));
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
示例4: TrainImage
public double TrainImage(double learnRate, double momentum, DoubleImage image, int classNr) {
double ret = VisionLabPINVOKE.BPN_ImageClassifier_Double_TrainImage(swigCPtr, learnRate, momentum, DoubleImage.getCPtr(image), classNr);
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
示例5: DeInterlace
public static void DeInterlace(DoubleImage image) {
VisionLabPINVOKE.DeInterlace__SWIG_6(DoubleImage.getCPtr(image));
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例6: CircleShape
public static void CircleShape(DoubleImage image, XYCoord centre, int r, double value, ZeroOrOriginal zorg) {
VisionLabPINVOKE.CircleShape__SWIG_12(DoubleImage.getCPtr(image), XYCoord.getCPtr(centre), r, value, (int)zorg);
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例7: AddBorder
public static void AddBorder(DoubleImage src, DoubleImage dest, int top, int left, int right, int bottom, double value) {
VisionLabPINVOKE.AddBorder__SWIG_6(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest), top, left, right, bottom, value);
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例8: NormaliseHue
public static void NormaliseHue(HSV888Image src, byte hue, byte minVal, byte minSat, DoubleImage dest, float notNormalised) {
VisionLabPINVOKE.NormaliseHue__SWIG_2(HSV888Image.getCPtr(src), hue, minVal, minSat, DoubleImage.getCPtr(dest), notNormalised);
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例9: ZeroCrossings
public static void ZeroCrossings(DoubleImage src, DoubleImage dest) {
VisionLabPINVOKE.ZeroCrossings__SWIG_13(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest));
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例10: VarianceFilter
public static void VarianceFilter(DoubleImage src, DoubleImage dest, FixEdge edge, Mask_Int32 mask) {
VisionLabPINVOKE.VarianceFilter__SWIG_6(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest), (int)edge, Mask_Int32.getCPtr(mask));
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例11: SNN_MedianFilter
public static void SNN_MedianFilter(DoubleImage src, DoubleImage dest, double radius, FixEdge edge) {
VisionLabPINVOKE.SNN_MedianFilter__SWIG_6(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest), radius, (int)edge);
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例12: NonMaximumSuppression
public static void NonMaximumSuppression(DoubleImage src, DoubleImage dest, DoubleImage direction, double dirScale) {
VisionLabPINVOKE.NonMaximumSuppression__SWIG_6(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest), DoubleImage.getCPtr(direction), dirScale);
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例13: LoGFilter
public static void LoGFilter(DoubleImage image, double sigma) {
VisionLabPINVOKE.LoGFilter__SWIG_13(DoubleImage.getCPtr(image), sigma);
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例14: LocalMinFilter
public static void LocalMinFilter(DoubleImage src, DoubleImage dest, double backGround, FixEdge edge, Mask_Int32 mask) {
VisionLabPINVOKE.LocalMinFilter__SWIG_6(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest), backGround, (int)edge, Mask_Int32.getCPtr(mask));
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}
示例15: InterpolateAtSpecificPixel
public static void InterpolateAtSpecificPixel(DoubleImage src, DoubleImage dest, double value) {
VisionLabPINVOKE.InterpolateAtSpecificPixel__SWIG_6(DoubleImage.getCPtr(src), DoubleImage.getCPtr(dest), value);
if (VisionLabPINVOKE.SWIGPendingException.Pending) throw VisionLabPINVOKE.SWIGPendingException.Retrieve();
}