Ejemplo n.º 1
0
        private void 相关性系数ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (curBitmap != null)
            {
                TEST test = new TEST();
                int[,] R = comm.getPixel(0, pictureBox1, N);
                int[,] G = comm.getPixel(1, pictureBox1, N);
                int[,] B = comm.getPixel(2, pictureBox1, N);

                double[,] corr = test.getCorr(R, G, B, N, 3000); //计算相关性
                label2.Text    = "相关性的计算";
                comm.showCorr(pictureBox2, corr);                //显示相关性
                recover();
            }
        }
Ejemplo n.º 2
0
        private void 一致平均改变强度UACIToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (curBitmap != null)
            {
                int[,] Ph2 = comm.getPixel(0, pictureBox1, N);
                MessageBox.Show("本测试结果由两次加密所生成,为保证结果正确,请之后输入两次相同的分解层数,谢谢!");

                TEST test = new TEST();

                int[][,] C = encForDiff(Ph2, N);
                double uaci = test.getUACI(C[0], C[1], N);
                MessageBox.Show("Hill矩阵与Haar域置乱综合加密系统: UACI = " + uaci + "%\n");
                recover();
            }
            else
            {
                MessageBox.Show("请打开一幅256X256图像!");
            }
        }
Ejemplo n.º 3
0
        private void 直方图ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (curBitmap != null)
            {
                int[,] P = comm.getPixel(0, pictureBox1, N);
                TEST test = new TEST();
                //直方图
                int[] hist = test.getHist(P, iw, ih);//取直方图数值
                comm.drawHist("左图的直方图", hist, pictureBox2, label2);

                //计算直方图方差
                float    msd  = test.getMSD(hist, iw);
                Graphics g    = pictureBox2.CreateGraphics();
                Font     font = new Font("", 12, FontStyle.Bold);//缺省字体、12号、Bold字型
                g.DrawString("方差: \n S = " + msd, font,
                             new SolidBrush(Color.Blue), 10, 200);
                recover();
            }
        }