| | |
| | | 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()) |