예제 #1
0
        /// <summary>
        /// 零水印算法调度
        /// </summary>
        private void Switch_algorithm1()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm1)
            {
            case 1:
                flag = (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("零水印参数导入出错!", "操作提示");
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    login.set_Hamming(zeroHarmming);
                    markLocate1       = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                    txtWaterMark.Text = watermark;
                }
                break;

            case 2:
                flag = (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4) &&
                       (parameter3 < 1) && (parameter3 > 0) && (parameter4 >= 3.57) && (parameter4 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("零水印参数导入出错!", "操作提示");
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    login.set_Hamming(zeroHarmming);
                    markLocate1       = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                    txtWaterMark.Text = myMark.LogisticChaos(parameter3, parameter4, watermark);
                }
                break;

            case 3:
            {
                flag = true;
                MarkProducer login = new MarkProducer();
                login.set_Hamming(zeroHarmming);
                markLocate1       = login.SuperChaos(parameter1, parameter2, parameter3, parameter4, markBit, sourceDBInfo);
                dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                txtWaterMark.Text = watermark;
            }
            break;

            default:
                MessageBox.Show("零水印算法导入出错!", "操作提示");
                break;
            }
        }
예제 #2
0
        /// <summary>
        /// 双重水印算法调度
        /// </summary>
        private void Switch_algorithm2()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm2)
            {
            case 1:
                flag = flag && float.TryParse(txtPara5.Text, out parameter5) && float.TryParse(txtPara6.Text, out parameter6);
                flag = flag && (parameter5 < 1) && (parameter5 > 0) && (parameter6 >= 3.57) && (parameter6 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("第三步参数设置出错!", "操作提示");
                    txtPara5.Clear();
                    txtPara6.Clear();
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    markLocate2     = login.Logistic(parameter5, parameter6, (picLen - 62) * 8, picDBInfo);
                    bufPic          = myMark.GetPic(picLen, picOffset1, picOffset2, picX, picY, markLocate2, TableName, DBType, picDBInfo[2]);
                    lblInfo.Content = "水印生成完毕!";
                    myPicShow();
                }
                break;

            case 2:
                flag = flag && float.TryParse(txtPara5.Text, out parameter5) && float.TryParse(txtPara6.Text, out parameter6) &&
                       float.TryParse(txtPara7.Text, out parameter7);
                flag = flag && (parameter5 <= 200) && (parameter5 >= 0) &&
                       (parameter6 < 1) && (parameter6 > 0) && (parameter7 >= 3.57) && (parameter7 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("第三步参数设置出错!", "操作提示");
                    txtPara5.Clear();
                    txtPara6.Clear();
                    txtPara7.Clear();
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    markLocate2 = login.Logistic(parameter6, parameter7, (picLen - 62) * 8, picDBInfo);
                    bufPic      = myMark.GetPic(picLen, picOffset1, picOffset2, picX, picY, markLocate2, TableName, DBType, picDBInfo[2]);
                    login.set_Hamming(picHarmming);
                    bufPic          = myMark.BitExPicMark((int)parameter5, parameter1, parameter2, (picX - 1) + (picY - 1) + 8, bufPic, 2);
                    lblInfo.Content = "水印生成完毕!";
                    myPicShow();
                }
                break;

            default:
                MessageBox.Show("请您选择第三步算法!", "操作提示");
                break;
            }
        }
예제 #3
0
        /// <summary>
        /// 双重水印算法调度
        /// </summary>
        private void Switch_algorithm2()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm2)
            {
            case 1:
                flag = flag && (parameter5 < 1) && (parameter5 > 0) && (parameter6 >= 3.57) && (parameter6 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("图像水印参数导入出错!", "操作提示");
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    markLocate2 = login.Logistic(parameter5, parameter6, (picLen - 62) * 8, picDBInfo);
                    bufPic      = myMark.GetPic(picLen, picOffset1, picOffset2, picX, picY, markLocate2, TableName, DBType, picDBInfo[2]);
                    myPicShow();
                }
                break;

            case 2:
                flag = flag && (parameter5 <= 200) && (parameter5 >= 0) &&
                       (parameter6 < 1) && (parameter6 > 0) && (parameter7 >= 3.57) && (parameter7 <= 4);

                if (flag == false)
                {
                    MessageBox.Show("图像水印参数导入出错!", "操作提示");
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    markLocate2 = login.Logistic(parameter6, parameter7, (picLen - 62) * 8, picDBInfo);
                    bufPic      = myMark.GetPic(picLen, picOffset1, picOffset2, picX, picY, markLocate2, TableName, DBType, picDBInfo[2]);
                    login.set_Hamming(picHarmming);
                    bufPic = myMark.BitExPicMark((int)parameter5, parameter1, parameter2, (picX - 1) + (picY - 1) + 8, bufPic, 2);
                    myPicShow();
                }
                break;

            default:
                MessageBox.Show("图像水印算法导入出错!", "操作提示");
                break;
            }
        }
예제 #4
0
        /// <summary>
        /// 双重水印算法调度
        /// </summary>
        private void Switch_algorithm2()
        {
            MarkProducer myMark = new MarkProducer();
            switch (algorithm2)
            {
                case 1:
                    flag = flag && (parameter5 < 1) && (parameter5 > 0) && (parameter6 >= 3.57) && (parameter6 <= 4);
                    if (flag == false)
                    {
                        MessageBox.Show("图像水印参数导入出错!", "操作提示");
                    }
                    else
                    {
                        MarkProducer login = new MarkProducer();
                        markLocate2 = login.Logistic(parameter5, parameter6, (picLen - 62) * 8, picDBInfo);
                        bufPic = myMark.GetPic(picLen, picOffset1, picOffset2, picX, picY, markLocate2, TableName, DBType, picDBInfo[2]);
                        myPicShow();
                    }
                    break;
                case 2:
                    flag = flag && (parameter5 <= 200) && (parameter5 >= 0)
                          && (parameter6 < 1) && (parameter6 > 0) && (parameter7 >= 3.57) && (parameter7 <= 4);

                     if (flag == false)
                    {
                        MessageBox.Show("图像水印参数导入出错!", "操作提示");
                    }
                    else
                    {
                        MarkProducer login = new MarkProducer();
                        markLocate2 = login.Logistic(parameter6, parameter7, (picLen - 62) * 8, picDBInfo);
                        bufPic = myMark.GetPic(picLen, picOffset1, picOffset2, picX, picY, markLocate2, TableName, DBType, picDBInfo[2]);
                        login.set_Hamming(picHarmming);
                        bufPic = myMark.BitExPicMark((int)parameter5, parameter1, parameter2, (picX - 1) + (picY - 1) + 8, bufPic, 2);
                        myPicShow();
                    }
                    break;

                default:
                    MessageBox.Show("图像水印算法导入出错!", "操作提示");
                    break;
            }
        }
예제 #5
0
 /// <summary>
 /// 零水印算法调度
 /// </summary>
 private void Switch_algorithm1()
 {
     MarkProducer myMark = new MarkProducer();
     switch (algorithm1)
     {
         case 1:
             flag = (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4);
             if (flag == false)
             {
                 MessageBox.Show("零水印参数导入出错!", "操作提示");
             }
             else
             {
                 MarkProducer login = new MarkProducer();
                 login.set_Hamming(zeroHarmming);
                 markLocate1 = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit, 2);
                 txtWaterMark.Text = watermark;
             }
             break;
         case 2:
             flag = (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4)
                 && (parameter3 < 1) && (parameter3 > 0) && (parameter4 >= 3.57) && (parameter4 <= 4);
             if (flag == false)
             {
                 MessageBox.Show("零水印参数导入出错!", "操作提示");
             }
             else
             {
                 MarkProducer login = new MarkProducer();
                 login.set_Hamming(zeroHarmming);
                 markLocate1 = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit, 2);
                 txtWaterMark.Text = myMark.LogisticChaos(parameter3, parameter4, watermark);
             }
             break;
         case 3:
             {
                 flag = true;
                 MarkProducer login = new MarkProducer();
                 login.set_Hamming(zeroHarmming);
                 markLocate1 = login.SuperChaos(parameter1, parameter2, parameter3, parameter4, markBit, sourceDBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit,2);
                 txtWaterMark.Text = watermark;
             }
             break;
         default:
             MessageBox.Show("零水印算法导入出错!", "操作提示");
             break;
     }
 }
        /// <summary>
        /// 双重水印算法调度
        /// </summary>
        private void Switch_algorithm2()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm2)
            {
                case 1:
                    flag = flag && float.TryParse(txtPara5.Text, out parameter5) && float.TryParse(txtPara6.Text, out parameter6);
                    flag = flag && (parameter5 < 1) && (parameter5 > 0) && (parameter6 >= 3.57) && (parameter6 <= 4);
                    if (flag == false)
                    {
                        MessageBox.Show("第三步参数设置出错!", "操作提示");
                        txtPara5.Clear();
                        txtPara6.Clear();
                    }
                    else
                    {
                        MarkProducer login = new MarkProducer();
                        markLocate2 = login.Logistic(parameter5, parameter6, (picLen - 62) * 8, picDBInfo);
                        bufPic = myMark.GetPic(picLen, picOffset1, picOffset2, picX, picY, markLocate2, TableName, DBType, picDBInfo[2]);
                        lblInfo.Content = "水印生成完毕!";
                        myPicShow();
                    }
                    break;
                case 2:
                   flag = flag && float.TryParse(txtPara5.Text, out parameter5) && float.TryParse(txtPara6.Text, out parameter6)
                        && float.TryParse(txtPara7.Text, out parameter7) ;
                    flag = flag && (parameter5 <= 200) && (parameter5 >= 0) 
                        && (parameter6 < 1) && (parameter6 > 0) && (parameter7 >= 3.57) && (parameter7 <= 4);
                    if (flag == false)
                    {
                        MessageBox.Show("第三步参数设置出错!", "操作提示");
                        txtPara5.Clear();
                        txtPara6.Clear();
                        txtPara7.Clear();
                    }
                    else
                    {
                        MarkProducer login = new MarkProducer();
                        markLocate2 = login.Logistic(parameter6, parameter7, (picLen - 62) * 8, picDBInfo);
                        bufPic = myMark.GetPic(picLen, picOffset1, picOffset2, picX, picY, markLocate2, TableName, DBType, picDBInfo[2]);
                        login.set_Hamming(picHarmming);
                        bufPic = myMark.BitExPicMark((int)parameter5,parameter1, parameter2, (picX - 1) + (picY - 1) + 8, bufPic, 2);
                        lblInfo.Content = "水印生成完毕!";
                        myPicShow();
                    }
                    break;

                default:
                    MessageBox.Show("请您选择第三步算法!", "操作提示");
                    break;
            }
        }
 /// <summary>
 /// 零水印算法调度
 /// </summary>
 private void Switch_algorithm1()
 {
     MarkProducer myMark = new MarkProducer();
     switch (algorithm1)
     {
         case 1:
             flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2);
             flag = flag && (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4);
             if (flag == false)
             {
                 MessageBox.Show("第二步参数设置出错!", "操作提示");
                 txtPara1.Clear();
                 txtPara2.Clear();
             }
             else
             {
                 MarkProducer login = new MarkProducer();
                 login.set_Hamming(zeroHarmming);
                 markLocate1 = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit, 2);
                 txtWaterMark.Text = watermark;
                 lblInfo.Content = "零水印生成完毕!";
             }
             break;
         case 2:
             flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2)
                 && float.TryParse(txtPara3.Text, out parameter3) && float.TryParse(txtPara4.Text, out parameter4);
             flag = flag && (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4)
                 && (parameter3 < 1) && (parameter3 > 0) && (parameter4 >= 3.57) && (parameter4 <= 4);
             if (flag == false)
             {
                 MessageBox.Show("第二步参数设置出错!", "操作提示");
                 txtPara1.Clear();
                 txtPara2.Clear();
                 txtPara3.Clear();
                 txtPara4.Clear();
             }
             else
             {
                 MarkProducer login = new MarkProducer();
                 login.set_Hamming(zeroHarmming);
                 markLocate1 = login.Logistic(parameter1, parameter2, markBit, DBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit, 2);
                 txtWaterMark.Text = myMark.LogisticChaos(parameter3, parameter4, watermark);
                 lblInfo.Content = "零水印生成完毕!";
             }
             break;
         case 3:
             flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2)
                && float.TryParse(txtPara3.Text, out parameter3) && float.TryParse(txtPara4.Text, out parameter4);
             if (flag == false)
             {
                 MessageBox.Show("第二步参数设置出错!", "操作提示");
                 txtPara1.Clear();
                 txtPara2.Clear();
                 txtPara3.Clear();
                 txtPara4.Clear();
             }
             else
             {
                 MarkProducer login = new MarkProducer();
                 login.set_Hamming(zeroHarmming);
                 markLocate1 = login.SuperChaos(parameter1, parameter2, parameter3, parameter4, markBit, DBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit, 2);
                 txtWaterMark.Text = watermark;
                 lblInfo.Content = "零水印生成完毕!";
             }
             break;
         default:
             MessageBox.Show("请您选择第二步算法!", "操作提示");
             break;
     }
 }
예제 #8
0
        /// <summary>
        /// 零水印算法调度
        /// </summary>
        private void Switch_algorithm1()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm1)
            {
            case 1:
                flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2);
                flag = flag && (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("第二步参数设置出错!", "操作提示");
                    txtPara1.Clear();
                    txtPara2.Clear();
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    login.set_Hamming(zeroHarmming);
                    markLocate1       = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                    txtWaterMark.Text = watermark;
                    lblInfo.Content   = "零水印生成完毕!";
                }
                break;

            case 2:
                flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2) &&
                       float.TryParse(txtPara3.Text, out parameter3) && float.TryParse(txtPara4.Text, out parameter4);
                flag = flag && (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4) &&
                       (parameter3 < 1) && (parameter3 > 0) && (parameter4 >= 3.57) && (parameter4 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("第二步参数设置出错!", "操作提示");
                    txtPara1.Clear();
                    txtPara2.Clear();
                    txtPara3.Clear();
                    txtPara4.Clear();
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    login.set_Hamming(zeroHarmming);
                    markLocate1       = login.Logistic(parameter1, parameter2, markBit, DBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                    txtWaterMark.Text = myMark.LogisticChaos(parameter3, parameter4, watermark);
                    lblInfo.Content   = "零水印生成完毕!";
                }
                break;

            case 3:
                flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2) &&
                       float.TryParse(txtPara3.Text, out parameter3) && float.TryParse(txtPara4.Text, out parameter4);
                if (flag == false)
                {
                    MessageBox.Show("第二步参数设置出错!", "操作提示");
                    txtPara1.Clear();
                    txtPara2.Clear();
                    txtPara3.Clear();
                    txtPara4.Clear();
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    login.set_Hamming(zeroHarmming);
                    markLocate1       = login.SuperChaos(parameter1, parameter2, parameter3, parameter4, markBit, DBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                    txtWaterMark.Text = watermark;
                    lblInfo.Content   = "零水印生成完毕!";
                }
                break;

            default:
                MessageBox.Show("请您选择第二步算法!", "操作提示");
                break;
            }
        }