private void CheckColorCamera2()
        {
            try
            {
                HOperatorSet.RotateImage(hoImageCamera2Rotated, out HObject hImageRotated, -90, "constant");

                string colorDetected = HalconProcedures.CheckColor(hImageRotated);

                if (colorDetected == string.Empty)
                {
                    Console.WriteLine("No color detected");
                    return;
                }

                if (colorDetected == selectedProgram.ColorCamera2)
                {
                    Console.WriteLine("Camera 2 color OK");
                }
                else
                {
                    Console.WriteLine("Camera 2 color NOK");
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("HALCON error #4056"))
                {
                    MessageBox.Show("No image camera 2", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void ButtonDetectColorCamera2Click(object sender, EventArgs e)
        {
            try
            {
                HOperatorSet.RotateImage(hoImageCamera2Rotated, out HObject hImageRotated, -90, "constant");

                string colorDetected = HalconProcedures.CheckColor(hImageRotated);

                comboBoxColorsCamera2.SelectedIndex = comboBoxColorsCamera2.FindStringExact(colorDetected.ToUpper());
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("HALCON error #4056"))
                {
                    MessageBox.Show("No image camera 2", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void CheckColorCamera1()
        {
            try
            {
                HOperatorSet.RotateImage(hoImageCamera1Rotated, out HObject hImageRotated, -90, "constant");

                string colorDetected = HalconProcedures.CheckColor(hImageRotated);

                hWindowControlCamera1.HalconWindow.SetFont("Arial-Bold-30");

                if (colorDetected == string.Empty)
                {
                    hWindowControlCamera1.HalconWindow.DispText("NO COLOR DETECTED", "image", 20, 20, "black", new HTuple(), new HTuple());
                    Console.WriteLine("No color detected");
                    return;
                }

                if (colorDetected == selectedProgram.ColorCamera1)
                {
                    hWindowControlCamera1.HalconWindow.DispText("COLOR OK", "image", 20, 20, "green", new HTuple(), new HTuple());
                    Console.WriteLine("Camera 1 color OK");
                }
                else
                {
                    hWindowControlCamera1.HalconWindow.DispText("COLOR NOK", "image", 20, 20, "red", new HTuple(), new HTuple());

                    Console.WriteLine("Camera 1 color NOK");
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("HALCON error #4056"))
                {
                    MessageBox.Show("No image camera 1", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }