本文整理汇总了C#中Emgu.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# Emgu.Copy方法的具体用法?C# Emgu.Copy怎么用?C# Emgu.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emgu
的用法示例。
在下文中一共展示了Emgu.Copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnFrame
protected override void OnFrame(Parsley.Core.BuildingBlocks.FrameGrabber fp, Emgu.CV.Image<Emgu.CV.Structure.Bgr, byte> img) {
if (_take_texture_image) {
_take_texture_image = false;
_texture_image = img.Copy();
lock (Context.Viewer) {
UpdateAllColors();
}
}
if (_clear_points) {
_clear_points = false;
_pixel_point_ids.Reset();
Context.Setup.ScanWorkflow.Reset();
_pointcloud.ClearPoints();
}
// Update the transformation between positioner coordinate system and camera coordinate system
if (_update_positioner_transformation)
{
_update_positioner_transformation = false;
Context.Setup.Positioner.UpdateTransformation(Context.Setup.Camera);
_pixel_point_ids.Reset();
Context.Setup.ScanWorkflow.Reset();
}
if (Context.Setup.Camera.FrameSize != _pixel_point_ids.Size) {
_pixel_point_ids.Size = Context.Setup.Camera.FrameSize;
}
List<Vector> points;
List<System.Drawing.Point> pixels;
if (Context.Setup.ScanWorkflow.Process(Context.Setup, img, out points, out pixels)) {
lock (Context.Viewer) {
UpdatePoints(points, pixels);
}
foreach (System.Drawing.Point p in pixels) {
img[p.Y, p.X] = new Bgr(Color.Green);
}
}
}
示例2: FindPattern
/// <summary>
/// Find checkerboard in image
/// </summary>
/// <param name="img">Image to search pattern for</param>
/// <param name="image_points">Detected checkerboard image points</param>
/// <returns>True if pattern was found, false otherwise</returns>
public override bool FindPattern(Emgu.CV.Image<Gray, byte> img, out System.Drawing.PointF[] image_points)
{
Emgu.CV.Image<Gray, byte> my_img = img.Copy();
my_img._EqualizeHist();
bool found = Emgu.CV.CameraCalibration.FindChessboardCorners(
my_img,
_inner_corners,
Emgu.CV.CvEnum.CALIB_CB_TYPE.ADAPTIVE_THRESH |
Emgu.CV.CvEnum.CALIB_CB_TYPE.FILTER_QUADS |
Emgu.CV.CvEnum.CALIB_CB_TYPE.NORMALIZE_IMAGE,
out image_points
);
if (found) {
my_img.FindCornerSubPix(
new System.Drawing.PointF[][] { image_points },
new System.Drawing.Size(5, 5),
new System.Drawing.Size(-1, -1),
new MCvTermCriteria(0.001));
}
return found;
}