Esempio n. 1
0
 public ProductImagesController(
     ImageMetrics imageMetrics,
     IImagesRepository imagesRepository)
 {
     _imageMetrics     = imageMetrics;
     _imagesRepository = imagesRepository;
 }
Esempio n. 2
0
 internal Image <Gray, byte> CreateEmguCvImage(byte[] image, ImageMetrics metrics)
 {
     return(new Image <Gray, byte>(metrics.Width, metrics.Height)
     {
         Bytes = image
     });
 }
Esempio n. 3
0
        // Surface image (byte array) to EmguCV image
        private Image <Gray, byte> CreateEmguCvImage(byte[] image, ImageMetrics metrics)
        {
            var result = new Image <Gray, byte>(metrics.Width, metrics.Height);

            result.Bytes = image;
            return(result);
        }
Esempio n. 4
0
 public void ProcessImage(byte[] image, ImageMetrics metrics, bool saveFrame)
 {
     PerformDetection(new Image <Gray, byte>(metrics.Width, metrics.Height)
     {
         Bytes = image
     }, saveFrame);
     //PerformOneTimeDetection(new Image<Gray, byte>(bitmap));
 }
Esempio n. 5
0
 //SurfaceImg to EmguCV Img
 private Image<Gray, byte> CreateEmguCvImage(byte[] image, ImageMetrics metrics)
 {
     return new Image<Gray, byte>(metrics.Width, metrics.Height) { Bytes = image };
 }
Esempio n. 6
0
        //helper method for OnContactRecordGesture method
        public void OnContactRecordHelper(byte[] pnormImg, ImageMetrics pimgMet)
        {
            emguCvImage = CreateEmguCvImage(pnormImg, pimgMet);

            processedByteArray = processImage(emguCvImage);
        }
        private static Rectangle ScaleBoundingBox(Rectangle boundingBox, ImageMetrics metrics, System.Drawing.Point appSize)
        {
            double scaleX = (double)metrics.Width / (double)appSize.X;
            double scaleY = (double)metrics.Height / (double)appSize.Y;

            boundingBox.X = (int)(boundingBox.X * scaleX);
            boundingBox.Y = (int)(boundingBox.Y * scaleY);
            boundingBox.Width = (int)(boundingBox.Width * scaleX);
            boundingBox.Height = (int)(boundingBox.Height * scaleY);

            return boundingBox;
        }