本文整理汇总了C#中UnmanagedImage.ToManagedImage方法的典型用法代码示例。如果您正苦于以下问题:C# UnmanagedImage.ToManagedImage方法的具体用法?C# UnmanagedImage.ToManagedImage怎么用?C# UnmanagedImage.ToManagedImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnmanagedImage
的用法示例。
在下文中一共展示了UnmanagedImage.ToManagedImage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessFilter
/// <summary>
/// Process the filter on the specified image.
/// </summary>
///
/// <param name="sourceData">Source image data.</param>
/// <param name="destinationData">Destination image data.</param>
///
protected override void ProcessFilter(UnmanagedImage sourceData, UnmanagedImage destinationData)
{
if (sourceData.PixelFormat == PixelFormat.Format8bppIndexed)
sourceData = toRGB.Apply(sourceData);
// Copy image contents
sourceData.Copy(destinationData);
Bitmap managedImage = destinationData.ToManagedImage(makeCopy: false);
using (Graphics g = Graphics.FromImage(managedImage))
using (Pen positive = new Pen(Color.Red))
using (Pen negative = new Pen(Color.Blue))
using (Pen line = new Pen(Color.FromArgb(0, 255, 0)))
{
// mark all points
foreach (SpeededUpRobustFeaturePoint p in points)
{
int S = (int)(scale * p.Scale);
int R = (int)(S / 2f);
Point pt = new Point((int)p.X, (int)p.Y);
Point ptR = new Point((int)(R * System.Math.Cos(p.Orientation)),
(int)(R * System.Math.Sin(p.Orientation)));
Pen myPen = (p.Laplacian > 0 ? negative : positive);
g.DrawEllipse(myPen, pt.X - R, pt.Y - R, S, S);
g.DrawLine(line, new Point(pt.X, pt.Y), new Point(pt.X + ptR.X, pt.Y + ptR.Y));
}
}
}
示例2: Show
/// <summary>
/// Displays an image on the screen.
/// </summary>
///
/// <param name="title">The text to display in the title bar of the image box.</param>
/// <param name="image">The image to show.</param>
/// <param name="sizeMode">How to display the image inside the image box.</param>
/// <param name="width">The width of the image box.</param>
/// <param name="height">The height of the image box.</param>
/// <param name="backColor">The background color to use in the window.
/// Default is <see cref="Color.Black"/>.</param>
///
public static DialogResult Show(string title, UnmanagedImage image,
PictureBoxSizeMode sizeMode, int width, int height, Color backColor)
{
return Show(title, image.ToManagedImage(), sizeMode, width, height, backColor);
}
示例3: Process
public void Process(UnmanagedImage uimage)
{
Bitmap image = uimage.ToManagedImage();
uimage = Grayscale.CommonAlgorithms.BT709.Apply(uimage);
OtsuThreshold otsuThresholdFilter = new OtsuThreshold();
otsuThresholdFilter.ApplyInPlace(uimage);
DifferenceEdgeDetector edgeDetector = new DifferenceEdgeDetector();
UnmanagedImage edgesImage = edgeDetector.Apply(uimage);
BlobCounter blobCounter = new BlobCounter();
blobCounter.FilterBlobs = true;
blobCounter.MinWidth = 6;
blobCounter.MinHeight = 6;
blobCounter.MaxWidth = 30;
blobCounter.MaxHeight = 150;
blobCounter.ProcessImage(edgesImage);
Blob[] blobs = blobCounter.GetObjectsInformation();
Blob[] laterais = new Blob[2];
Blob[] ordenado = new Blob[2];
string[] letras_respostas = new string[10];
Graphics g = Graphics.FromImage(image);
Pen greenPen = new Pen(Color.Green, 2);
Pen blackPen = new Pen(Color.Black, 2);
Pen whitePen = new Pen(Color.White, 2);
Pen penIn = new Pen(Color.Yellow, 2);
int numero_codigo = 0;
//apenas visualizacao dos quadrantes
System.Drawing.Point[] arrumados = new System.Drawing.Point[8];
System.Drawing.PointF[] quadro_codigo = new System.Drawing.PointF[4];
System.Drawing.Point[] p1 = new System.Drawing.Point[4];
System.Drawing.PointF[] tabela_codigo = new System.Drawing.PointF[112];
System.Drawing.Point[] tabela_codigoa = new System.Drawing.Point[112];
System.Drawing.PointF[] quadrado0 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado1 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado2 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado3 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado4 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado5 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado6 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado7 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado8 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado9 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado10 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado11 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado12 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado13 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado14 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado15 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado16 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado17 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado18 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado19 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado20 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado21 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado22 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado23 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado24 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado25 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado26 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado27 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado28 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado29 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado30 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado31 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado32 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado33 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado34 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado35 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado36 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado37 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado38 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado39 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado40 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado41 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado42 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado43 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado44 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado45 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado46 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado47 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado48 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado49 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado50 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado51 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado52 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado53 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado54 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado55 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado56 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado57 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado58 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado59 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado60 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado61 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado62 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado63 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado64 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado65 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado66 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado67 = new System.Drawing.PointF[4];
System.Drawing.PointF[] quadrado68 = new System.Drawing.PointF[4];
//.........这里部分代码省略.........