Example #1
0
        static void Main(string[] args)
        {
            var keyWord        = "lena";
            var inPicture      = keyWord + ".jpg";
            var changedPicture = keyWord + "_changed.jpg";
            var qr             = "QRcode_phone.png";
            var qr_extracted   = keyWord + "_QR.jpg";



            DoubleImage initialImage, changedImage;

            using (Bitmap imageBitmap = new Bitmap("landscape.jpg")) //lena_changed.jpg
            {
                initialImage = new DoubleImage(imageBitmap);
            }

            using (Bitmap imageBitmap = new Bitmap("landscape_changed_cr.png"))
            {
                changedImage = new DoubleImage(imageBitmap);
            }

            DoubleImage full   = DoubleImage.FillWithSmallerImage(initialImage, changedImage);
            Bitmap      result = full.ToBitmap(1, 0);

            result.Save("full.jpg");


            Console.WriteLine("Done");
            Console.ReadKey();
        }
Example #2
0
        static void Main(string[] args)
        {
            var keyWord        = "roses";
            var inPicture      = keyWord + ".jpg";
            var changedPicture = keyWord + "_changed.jpg";
            var qr             = "QRcode_phone.png";
            var qr_extracted   = keyWord + "_QR.jpg";


            DoubleImage image;

            using (Bitmap imageBM = new Bitmap(inPicture)) //lena_changed.jpg
            {
                image = new DoubleImage(imageBM);
            }

            /*Watermark watermark;
             * using (Bitmap imageBM = new Bitmap(qr)) //lena_changed.jpg
             * {
             *  DoubleImage imageTemp = new DoubleImage(imageBM);
             *  watermark = new Watermark(imageTemp);
             * }
             *
             * JRKimAlgorithm algorithm = new JRKimAlgorithm();
             * DoubleImage changed = algorithm.KIMembed(image, watermark);
             * Bitmap result = changed.ToBitmap(1, 0);
             * result.Save(changedPicture); */

            DoubleImage black;

            using (Bitmap imageBM = new Bitmap("black_cr.jpg")) //lena_changed.jpg
            {
                black = new DoubleImage(imageBM);
            }
            double[,] blue  = image.GetColorComponent(DoubleImage.ColorComponent.Blue);
            double[,] red   = image.GetColorComponent(DoubleImage.ColorComponent.Red);
            double[,] green = image.GetColorComponent(DoubleImage.ColorComponent.Green);

            /*double[,] changed_blue = Wavelet.Transform(blue, 1);
             * double[,] changed_green = Wavelet.Transform(green, 1);
             * double[,] changed_red = Wavelet.Transform(red, 1);*/
            //black.UpdateColorComponent(DoubleImage.ColorComponent.Red, red);
            black.UpdateColorComponent(DoubleImage.ColorComponent.Red, red);
            // black.UpdateColorComponent(DoubleImage.ColorComponent.Green, green);
            Bitmap result = black.ToBitmap(1, 0);

            result.Save("roses_red.jpg");

            /*DoubleImage initialImage, changedImage;
             *
             * using (Bitmap imageBitmap = new Bitmap(inPicture)) //lena_changed.jpg
             * {
             *  initialImage = new DoubleImage(imageBitmap);
             * }
             *
             * using (Bitmap imageBitmap = new Bitmap(changedPicture))
             * {
             *  changedImage = new DoubleImage(imageBitmap);
             * }
             *
             * JRKimAlgorithm algorithm = new JRKimAlgorithm();
             * DoubleImage watermark = algorithm.KIMextract(initialImage, changedImage, 100, 100);
             * Bitmap result = watermark.ToBitmap(1,0);
             * result.Save(qr_extracted);*/


            Console.WriteLine("Done");
            Console.ReadKey();
        }