예제 #1
0
        public Stream getMIA(string index, string session)
        {
            ImgRecord r       = sessions[session][int.Parse(index)];
            Stream    fstream = safeOpen("File" + r.file);
            Bitmap    image   = new Bitmap(fstream);

            int width  = image.Size.Width;
            int height = image.Size.Height;

            Rectangle MIARect = trimRect(miaFinder.mostInterestingArea(image), image);

            /*
             * String[] parts = imageFilePath.Split('-');
             * String index = parts[0];
             * String session = parts[1];
             */
            //  Bitmap image2 = ObjectCopier.Clone(image);
            //Rule of thirds
            Rectangle ROTRect = trimRect(rotFinder.mostInterestingArea(image), image);

            //Most colorful

            //   Bitmap image3 = ObjectCopier.Clone(image);
            Rectangle MCRect = trimRect(mcaFinder.mostInterestingArea(image), image);

            //Rectangle MCRect = new Rectangle(10, 50, 10, 100);
            fstream.Dispose();
            image.Dispose();
            String styleText = "" + MIARect.Top + ";" + MIARect.Left + ";" + MIARect.Width + ";" + MIARect.Height + ";" + ROTRect.Top + ";" + ROTRect.Left + ";" + ROTRect.Width + ";" + ROTRect.Height + ";" + +MCRect.Top + ";" + MCRect.Left + ";" + MCRect.Width + ";" + MCRect.Height
                               + ";" + width + ";" + height;

            return(new MemoryStream(Encoding.UTF8.GetBytes(styleText)));
        }
예제 #2
0
 public Rectangle mostInterestingArea()
 {
     return(algorithm.mostInterestingArea(img));
 }