You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.2 KiB
C#

using HalconDotNet;
using Rs.Controls;
using Rs.Framework;
using Rs.MotionPlat.Commom;
using Rs.MotionPlat.Flow;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
namespace Rs.MotionPlat.SysConfig
{
public partial class UpCameraAndClampCalibration : BaseForm
{
public UpCameraAndClampCalibration()
{
InitializeComponent();
cameraTemplate1.ItemName = "上相机与吸嘴中心标定";
cameraTemplate1.SetFindShapeMode(EFindShapeMode.SelfDefine);
cameraTemplate1.FindShapeEvent += CameraTemplate1_FindShapeEvent;
}
private void CameraTemplate1_FindShapeEvent(ChoiceTech.Halcon.Control.HWindow_Final win, HObject sourceImage)
{
//HOperatorSet.Threshold(sourceImage, out HObject regions, 0, 150);
//HOperatorSet.Connection(regions, out HObject connectedRegions);
//HOperatorSet.SelectShape(connectedRegions, out HObject selectedRegion, "circularity", "and", 0.5, 1);
//HOperatorSet.FillUp(selectedRegion, out HObject regionFillUp);
//HOperatorSet.SmallestCircle(regionFillUp, out HTuple row,out HTuple column,out HTuple radius);
//HOperatorSet.GenCrossContourXld(out HObject cross, row, column, 30, 0);
//HOperatorSet.GenCircle(out HObject cicle,row,column,radius);
//win.DispObj(cicle, "green");
//win.DispObj(cross, "green");
}
private void UpCameraAndClampCalibration_Load(object sender, EventArgs e)
{
PositionHelper.BindPosition(groupBox1);
}
protected void Fetch_Position(object sender, EventArgs e)
{
PositionHelper.Teach(this, sender,"X,Y");
}
protected void GotoThis(object sender, EventArgs e)
{
if (Ops.IsHomed("LoadX", "LoadY"))
{
PositionHelper.Move2This(this, sender,"X,Y");
}
}
}
}