本文整理汇总了C#中Emgu.CV.Mat.ToUIImage方法的典型用法代码示例。如果您正苦于以下问题:C# Mat.ToUIImage方法的具体用法?C# Mat.ToUIImage怎么用?C# Mat.ToUIImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emgu.CV.Mat
的用法示例。
在下文中一共展示了Mat.ToUIImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
RootElement root = Root;
root.UnevenRows = true;
UIImageView imageView = new UIImageView(View.Frame);
StringElement messageElement = new StringElement("");
StringElement licenseElement = new StringElement("");
root.Add(new Section()
{ new StyledStringElement("Process", delegate {
using (Image<Bgr, Byte> image = new Image<Bgr, byte>( "license-plate.jpg"))
{
LicensePlateDetector detector = new LicensePlateDetector(".");
Stopwatch watch = Stopwatch.StartNew(); // time the detection process
List<IInputOutputArray> licensePlateImagesList = new List<IInputOutputArray>();
List<IInputOutputArray> filteredLicensePlateImagesList = new List<IInputOutputArray>();
List<RotatedRect> licenseBoxList = new List<RotatedRect>();
List<string> words = detector.DetectLicensePlate(
image,
licensePlateImagesList,
filteredLicensePlateImagesList,
licenseBoxList);
watch.Stop(); //stop the timer
messageElement.Value = String.Format("{0} milli-seconds", watch.Elapsed.TotalMilliseconds);
StringBuilder builder = new StringBuilder();
foreach (String w in words)
builder.AppendFormat("{0} ", w);
licenseElement.Value = builder.ToString();
messageElement.GetImmediateRootElement().Reload(messageElement, UITableViewRowAnimation.Automatic);
licenseElement.GetImmediateRootElement().Reload(licenseElement, UITableViewRowAnimation.Automatic);
foreach (RotatedRect box in licenseBoxList)
{
image.Draw(box, new Bgr(Color.Red), 2);
}
Size frameSize = FrameSize;
using (Mat resized = new Mat())
{
CvInvoke.ResizeForFrame(image, resized, frameSize);
imageView.Image = resized.ToUIImage();
imageView.Frame = new RectangleF(PointF.Empty, resized.Size);
}
imageView.SetNeedsDisplay();
ReloadData();
}
}
)});
root.Add(new Section("Recognition Time") { messageElement });
root.Add(new Section("License Plate") { licenseElement });
root.Add(new Section() { imageView });
}