Example #1
0
 private void VITBtn_Click(object sender, EventArgs e)
 {
     VITModel model = new VITModel(param.R, param.L1, param.L2, param.S1, param.S2, param.K, 0,0,0, param.Size, bgAndObj.GetH);
       vitImg = model.AppVIT(bgAndObj, OptSysCheckBox.Checked, H0CheckBox.Checked, HkCheckBox.Checked, NoiseCheckBox.Checked, param.Sigma, param.X0);
       pictureBox2.Image = vitImg.CImageToBitmap();
       vitImg.CImageToBitmap().Save("vit.bmp");
 }
Example #2
0
        private void VITAnalyssBTN_Click(object sender, EventArgs e)
        {
            CImage<double> background4N = Background.GetBackground(1024, 1024, param.Alfa, param.Df, param.Mf);
            CImage<double> bgAndObj4N = new CImage<double>(1024, 1024);
            Objects.GetObjects(background4N, out bgAndObj4N, 1024 / 256 * param.Radius, param.Q, param.Xmin, param.Xmax, !checkBox1.Checked);
            CImage<double> bgAndObj2N = new CImage<double>(512, 512);
            for (int i = 0; i < 512; i++)
            {
            for (int j = 0; j < 512; j++)
            {
                bgAndObj2N[i, j] = bgAndObj4N[i * 2, j * 2];
            }
            }

            CImage<double> bgAndObjN = new CImage<double>(256, 256);
            for (int i = 0; i < 256; i++)
            {
            for (int j = 0; j < 256; j++)
            {
                bgAndObjN[i, j] = bgAndObj4N[i * 4, j * 4];
            }
            }

            VITModel modelN = new VITModel(param.R, param.L1, param.L2, param.S1, param.S2, param.K, 0, 0, 0, 256, 256);
            CImage<double> vitImgN = modelN.AppVIT(bgAndObjN, OptSysCheckBox.Checked, H0CheckBox.Checked, HkCheckBox.Checked, NoiseCheckBox.Checked, param.Sigma, param.X0);

            VITModel model2N = new VITModel(param.R, param.L1, param.L2, param.S1, param.S2, param.K, 0, 0, 0, 256, 512);
            CImage<double> vitImg2N = model2N.AppVIT(bgAndObj2N, OptSysCheckBox.Checked, H0CheckBox.Checked, HkCheckBox.Checked, NoiseCheckBox.Checked, param.Sigma, param.X0);

            VITModel model4N = new VITModel(param.R, param.L1, param.L2, param.S1, param.S2, param.K, 0, 0, 0, 256, 1024);
            CImage<double> vitImg4N = model4N.AppVIT(bgAndObj4N, OptSysCheckBox.Checked, H0CheckBox.Checked, HkCheckBox.Checked, NoiseCheckBox.Checked, param.Sigma, param.X0);

            pictureBox1.Image = vitImgN.CImageToBitmap();
            pictureBox2.Image = vitImg2N.CImageToBitmap();
            pictureBox3.Image = vitImg4N.CImageToBitmap();

            double SKO = 0;
            for (int i = 0; i < 256; i++)
            {
            for (int j = 0; j < 256; j++)
            {
                SKO += ((vitImgN[i, j] - vitImg2N[i, j]) * (vitImgN[i, j] - vitImg2N[i, j]));
            }
            }
            SKO /= (256 * 256);
            SKOTB12.Text = SKO.ToString();
            SKO = 0;
            for (int i = 0; i < 256; i++)
            {
            for (int j = 0; j < 256; j++)
            {
                SKO += ((vitImg2N[i, j] - vitImg4N[i, j]) * (vitImg2N[i, j] - vitImg4N[i, j]));
            }
            }
            SKO /= (256 * 256);
            SKOTB24.Text = SKO.ToString();
        }