C3204
2025-12-30 4b3a410a5083970bb2e56d2ab459d860c4fa22d0
LB_VisionProcesses/Alogrithms/OpenCvSharp/BlobTool/BlobToolEdit.cs
@@ -120,11 +120,10 @@
                if (Subject.InputImage != null && Subject.InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.InputImage))
                    {
                        inputImageHSmartWindowControl.ShowHoImage(image);
                    }
                    TAlgorithm.Mat2HObject((Mat)Subject.InputImage, out HObject image);
                    inputImageHSmartWindowControl.ShowHoImage(image);
                }
                Type type = Subject.Params.ROI?.GetType();
                if (Subject.Params.ROI != null)
                {
@@ -216,11 +215,9 @@
                if (Subject.InputImage != null && Subject.InputImage is Mat)
                {
                    using (HImage image = TAlgorithm.Mat2HObject((Mat)Subject.InputImage))
                    {
                        HOperatorSet.GetImageSize(image, out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                        recordImageHSmartWindowControl.ShowHoImage(image);
                    }
                    TAlgorithm.Mat2HObject((Mat)Subject.InputImage, out HObject image);
                    HOperatorSet.GetImageSize(image, out HTuple ho_ImageWidth, out HTuple ho_ImageHeight);
                    recordImageHSmartWindowControl.ShowHoImage(image);
                }
                //先判断子类再判断父类
@@ -228,11 +225,10 @@
                {
                    recordImageHSmartWindowControl.DispObj(msgRecord.RecordObject_OK, true);
                    recordImageHSmartWindowControl.DispObj(msgRecord.RecordObject_NG, false);
                    for (int i = 0; i < msgRecord.Msg.Length; i++)
                    {
                        recordImageHSmartWindowControl.ShowMsg(msgRecord.Msg[i]
                            , 1 == msgRecord.Result[i] ? true : false, msgRecord.Column[i], msgRecord.Row[i]);
                    }
                }
                else if (Subject.Record != null && Subject.Record is ObjectRecord objRecord)
                {
@@ -306,34 +302,32 @@
                    HTuple hv_imageHeight = 0;
                    if (InputImage != null && InputImage is Mat)
                    {
                        using (HImage image = TAlgorithm.Mat2HObject((Mat)InputImage))
                        {
                            image.GetImageSize(out hv_imageWidth, out hv_imageHeight);
                            switch (type)
                            {
                                case RoiType.Rectangle2:
                                    inputImageHSmartWindowControl.oRoi
                                        = new HRectangle2(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2, 0
                                        , hv_imageWidth.TupleReal() / 4, hv_imageHeight.TupleReal() / 4);
                                    break;
                                case RoiType.Circle:
                                    inputImageHSmartWindowControl.oRoi
                                        = new HCircle(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2, hv_imageWidth.TupleReal() / 4);
                                    break;
                                //case RoiType.Ellipse:
                                //    inputImageHSmartWindowControl.oRoi
                                //        = new HEllipse(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2,0, hv_imageHeight.TupleReal() / 4, hv_imageWidth.TupleReal() / 4);
                                //    break;
                                //case RoiType.Segment:
                                //    inputImageHSmartWindowControl.oRoi
                                //        = new HSegment(0, 0, hv_imageWidth.TupleReal() / 4, hv_imageHeight.TupleReal() / 4);
                                //    break;
                                case RoiType.None:
                                default:
                                    inputImageHSmartWindowControl.oRoi = null;
                                    break;
                            }
                        }
                        TAlgorithm.Mat2HObject((Mat)InputImage, out HObject image);
                        HOperatorSet.GetImageSize(image, out hv_imageWidth, out hv_imageHeight);
                    }
                    switch (type)
                    {
                        case RoiType.Rectangle2:
                            inputImageHSmartWindowControl.oRoi
                                = new HRectangle2(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2, 0
                                , hv_imageWidth.TupleReal() / 4, hv_imageHeight.TupleReal() / 4);
                            break;
                        case RoiType.Circle:
                            inputImageHSmartWindowControl.oRoi
                                = new HCircle(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2, hv_imageWidth.TupleReal() / 4);
                            break;
                        //case RoiType.Ellipse:
                        //    inputImageHSmartWindowControl.oRoi
                        //        = new HEllipse(hv_imageWidth.TupleReal() / 2, hv_imageHeight.TupleReal() / 2,0, hv_imageHeight.TupleReal() / 4, hv_imageWidth.TupleReal() / 4);
                        //    break;
                        //case RoiType.Segment:
                        //    inputImageHSmartWindowControl.oRoi
                        //        = new HSegment(0, 0, hv_imageWidth.TupleReal() / 4, hv_imageHeight.TupleReal() / 4);
                        //    break;
                        case RoiType.None:
                        default:
                            inputImageHSmartWindowControl.oRoi = null;
                            break;
                    }
                }
            }