Exemplo n.º 1
0
 public HDResult(MyImageDouble HDR)
 {
     this.HDR = HDR;
     response = new double[HDR.numCh][];
     for (int i = 0; i < HDR.numCh; ++i)
     {
         response[i] = new double[256];
     }
 }
Exemplo n.º 2
0
        private static MyImageDouble[] getChannelFromimages(MyImage[] images, int ch)
        {
            int imagesCount = images.Length;

            MyImageDouble[] imagesChannels = new MyImageDouble[imagesCount];
            for (int i = 0; i < imagesCount; ++i)
            {
                imagesChannels[i] = new MyImageDouble(images[i].bitplane[ch], images[i].exposureTime);
            }
            return(imagesChannels);
        }
Exemplo n.º 3
0
        private void buttonHDR_Click(object sender, RoutedEventArgs e)
        {
            var watch = System.Diagnostics.Stopwatch.StartNew();

            labelOutput.Content = "";

            OpenFileDialog dialog = new OpenFileDialog
            {
                Filter      = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif) | *.jpg; *.jpeg; *.jpe; *.jfif",
                Title       = "Please select image",
                Multiselect = true
            };

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                // Load images
                MyImage[] images = loadImages(dialog.FileNames);

                // Get parameters
                int smoothfactor = (int)getParamater(textboxSmoothFactor);
                int samples      = (int)getParamater(textboxSample);

                // Display images
                drawImages(images);

                // Process images
                HDResult hdrResult = ImageProcessing.HDR(images, smoothfactor, samples);

                // Draw response graphs
                drawReponsesGraph(hdrResult.response);

                // Save HDR image
                HDRImage = hdrResult.HDR;

                MyImage tempImage = HDRImage.ToMyImage();

                // Show HDR image
                processedImage.Source = Utils.getSource(tempImage.GetBitmap());

                // Create histograms
                displayHistograms(tempImage);
            }

            watch.Stop();
            string timeTaken = String.Format(" HDR {0} ms", watch.ElapsedMilliseconds.ToString());

            Console.WriteLine(timeTaken);
            labelOutput.Content += timeTaken;
        }