private ImageAndStats GetMatchableSegments(PhysicalImage physicalImage)
        {
            var img = _loader.LoadImage(physicalImage.ImagePath);
            // For movie stills with widescreen bars above/below, start further down and end higher up
            IEnumerable <Rectangle> rects = GetSegmentRectangles(new Rectangle(6, 6, img.Width - 12, img.Height - 12));
            // IEnumerable<Rectangle> rects = GetSegmentRectangles(new Rectangle(0, 0, img.Width, img.Height));
            var segmentStats = new List <SegmentAndStats>();

            foreach (var rectangle in rects)
            {
                var imageManipulationInfo   = new ImageManipulationInfo(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
                Stats.BasicStats basicStats = GetStats(physicalImage,
                                                       imageManipulationInfo);
                segmentStats.Add(new SegmentAndStats(imageManipulationInfo, basicStats));
            }

            return(new ImageAndStats(physicalImage, segmentStats));
        }
Exemple #2
0
 public SegmentAndStats(ImageManipulationInfo manipulationInfo, BasicStats stats)
 {
     ManipulationInfo = manipulationInfo;
     Stats            = stats;
 }
 public ImageAndStats(PhysicalImage image, ImageManipulationInfo manipulationInfo, BasicStats stats)
     : this(image, new [] { new SegmentAndStats(manipulationInfo, stats), })
 {
 }