|
|
@ -54,11 +54,6 @@ namespace Rs.Controls
|
|
|
|
this.eFindShapeMode = eFindShapeMode;
|
|
|
|
this.eFindShapeMode = eFindShapeMode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AttachFindShapeEvent(Action<HWindow_Final, HObject> fun)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
FindShapeEvent = fun;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int i = 0;
|
|
|
|
static int i = 0;
|
|
|
|
private void Instance_GrabOkEvent(int arg1, HObject arg2)
|
|
|
|
private void Instance_GrabOkEvent(int arg1, HObject arg2)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -577,6 +572,8 @@ namespace Rs.Controls
|
|
|
|
pm.AngleStart = int.Parse(txtAngleStart.Text);
|
|
|
|
pm.AngleStart = int.Parse(txtAngleStart.Text);
|
|
|
|
pm.AngleExtent = int.Parse(txtAngleExtent.Text);
|
|
|
|
pm.AngleExtent = int.Parse(txtAngleExtent.Text);
|
|
|
|
pm.Score = double.Parse(txtScore.Text);
|
|
|
|
pm.Score = double.Parse(txtScore.Text);
|
|
|
|
|
|
|
|
pm.Exposure=int.Parse(txtExposure.Text);
|
|
|
|
|
|
|
|
pm.Gain = int.Parse(txtGain.Text);
|
|
|
|
//pm.ItemName = m_itemName;
|
|
|
|
//pm.ItemName = m_itemName;
|
|
|
|
pm.SaveModel(m_savePath);
|
|
|
|
pm.SaveModel(m_savePath);
|
|
|
|
Msg.ShowInfo("Save product model success!");
|
|
|
|
Msg.ShowInfo("Save product model success!");
|
|
|
@ -634,6 +631,7 @@ namespace Rs.Controls
|
|
|
|
HOperatorSet.GetImageSize(hImage, out HTuple imgWidth, out HTuple imgHeight);
|
|
|
|
HOperatorSet.GetImageSize(hImage, out HTuple imgWidth, out HTuple imgHeight);
|
|
|
|
HOperatorSet.GenCrossContourXld(out HObject camCenter, imgHeight / 2, imgWidth / 2, Math.Max(imgHeight, imgWidth), 0);
|
|
|
|
HOperatorSet.GenCrossContourXld(out HObject camCenter, imgHeight / 2, imgWidth / 2, Math.Max(imgHeight, imgWidth), 0);
|
|
|
|
hWindow_Final1.DispObj(camCenter, "green");
|
|
|
|
hWindow_Final1.DispObj(camCenter, "green");
|
|
|
|
|
|
|
|
FindShapeEvent?.Invoke(hWindow_Final1, hImage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -713,12 +711,16 @@ namespace Rs.Controls
|
|
|
|
string angleStart = ini.ReadValue("ModelParam", "AngleStart");
|
|
|
|
string angleStart = ini.ReadValue("ModelParam", "AngleStart");
|
|
|
|
string angleExtent = ini.ReadValue("ModelParam", "AngleExtent");
|
|
|
|
string angleExtent = ini.ReadValue("ModelParam", "AngleExtent");
|
|
|
|
string score = ini.ReadValue("ModelParam", "Score");
|
|
|
|
string score = ini.ReadValue("ModelParam", "Score");
|
|
|
|
|
|
|
|
string exposure = ini.ReadValue("ModelParam", "Exposure");
|
|
|
|
|
|
|
|
string gain = ini.ReadValue("ModelParam", "Gain");
|
|
|
|
if (!string.IsNullOrEmpty(contrast) && !string.IsNullOrEmpty(angleStart) && !string.IsNullOrEmpty(angleExtent) && !string.IsNullOrEmpty(score))
|
|
|
|
if (!string.IsNullOrEmpty(contrast) && !string.IsNullOrEmpty(angleStart) && !string.IsNullOrEmpty(angleExtent) && !string.IsNullOrEmpty(score))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tbarContrast.Value = int.Parse(contrast);
|
|
|
|
tbarContrast.Value = int.Parse(contrast);
|
|
|
|
txtAngleStart.Text = angleStart;
|
|
|
|
txtAngleStart.Text = angleStart;
|
|
|
|
txtAngleExtent.Text = angleExtent;
|
|
|
|
txtAngleExtent.Text = angleExtent;
|
|
|
|
txtScore.Text = score;
|
|
|
|
txtScore.Text = score;
|
|
|
|
|
|
|
|
txtExposure.Text = exposure;
|
|
|
|
|
|
|
|
txtGain.Text = gain;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -806,5 +808,29 @@ namespace Rs.Controls
|
|
|
|
|
|
|
|
|
|
|
|
hWindow_Final1.DrawModel = false;
|
|
|
|
hWindow_Final1.DrawModel = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int GetExposure()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(int.TryParse(txtExposure.Text,out int value))
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int GetGain()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(int.TryParse((txtGain.Text),out int value))
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public HObject GetImage()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return hImage;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DataGridViewRowCollection GetResultRows()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return this.dataGridView1.Rows;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|