Ejemplo n.º 1
0
        //Compute the pixel value and add it in histogram bin
        private void computePixelValue(List <string> files)
        {
            foreach (string filepath in files)
            {
                HistogramBin histogramBinIntensity = new HistogramBin();
                histogramBinIntensity.initializeHistogramIntensityMethod();
                histogramBinIntensity.initializehistogramColorCodeMethod();
                histogramBinIntensity.setImageId(filepath);

                Bitmap b          = new Bitmap(filepath, true);
                int    width      = b.Width;
                int    height     = b.Height;
                int    totalPixel = height * width;
                histogramBinIntensity.setNumberOfPixelImage(totalPixel);
                for (int i = 0; i < width; i++)
                {
                    for (int j = 0; j < height; j++)
                    {
                        Color pixel = b.GetPixel(i, j);
                        byte  red   = pixel.R;
                        byte  green = pixel.G;
                        byte  blue  = pixel.B;

                        //Colorcode method
                        int colorCode = (blue & (192)) >> 6 | (green & (192)) >> 4 | (red & (192)) >> 2;
                        histogramBinIntensity.addElementHistogramColorCodeMethod(colorCode);
                        //Intensity method
                        double I = 0.299 * red + 0.587 * green + 0.114 * blue;
                        histogramBinIntensity.addIntensityToBin(I);
                    }
                }
                allimageDetailIntensityMethod.Add(histogramBinIntensity);
            }
            //call rf method and initialize histogram for RF method
            RfMethod callRfMethod = new RfMethod();

            rfMethodHistogram = callRfMethod.createHistogramRfMethod(allimageDetailIntensityMethod);
        }
Ejemplo n.º 2
0
        //Call RF method and pass histogram
        public void createRFMethodDetails()
        {
            RfMethod rfMethodCall = new RfMethod();

            rfMethodCall.createHistogramRfMethod(allimageDetailIntensityMethod);
        }