| | |
| | | return res; |
| | | } |
| | | |
| | | public bool GetImage(Layout layout, out HObject InputImage, out HObject RecordImage) |
| | | public bool GetImage(Layout layout, out HImage InputImage, out HObject RecordImage) |
| | | { |
| | | InputImage = null; RecordImage = null; |
| | | try |
| | |
| | | IndexValueName = arrOutputs[2]; |
| | | |
| | | object o_InputImage = ((IProcess)dicContext[IndexProcessName]).OutputImage; |
| | | if (o_InputImage is HObject ho_image && ho_image.IsInitialized()) |
| | | if (o_InputImage is HImage ho_image && ho_image.IsInitialized()) |
| | | InputImage = ho_image; |
| | | else if (o_InputImage is Bitmap) |
| | | { |
| | | //将Mat转换为HObject |
| | | TAlgorithm.Bitmap2HObject((Bitmap)o_InputImage, out HObject ho_RecordImage); |
| | | InputImage = ho_RecordImage; |
| | | using (HImage ho_RecordImage = TAlgorithm.Bitmap2HObject((Bitmap)o_InputImage)) |
| | | { |
| | | InputImage = ho_RecordImage.Clone(); |
| | | } |
| | | } |
| | | else if (o_InputImage is Mat) |
| | | { |
| | | //将Mat转换为HObject |
| | | TAlgorithm.Mat2HObject((Mat)o_InputImage, out HObject ho_RecordImage); |
| | | InputImage = ho_RecordImage; |
| | | using (HImage ho_RecordImage = TAlgorithm.Mat2HObject((Mat)o_InputImage)) |
| | | { |
| | | InputImage = ho_RecordImage.Clone(); |
| | | } |
| | | } |
| | | |
| | | if (InputImage != null && InputImage.IsInitialized()) |
| | |
| | | [Node("相机取图", "取像工具", "Basic", "相机取图")] |
| | | public void 相机取图(FlowNode node) { RunNodeAsync(node); } |
| | | |
| | | [Node("Halcon2D斑点工具", "Haclon2D工具", "Basic", "Halcon2D斑点工具")] |
| | | [Node("Halcon2D斑点工具", "Halcon2D工具", "Basic", "Halcon2D斑点工具")] |
| | | public void Halcon2D斑点工具(FlowNode node) { RunNodeAsync(node); } |
| | | |
| | | |
| | | #endregion |
| | | |