public ProductImagesController( ImageMetrics imageMetrics, IImagesRepository imagesRepository) { _imageMetrics = imageMetrics; _imagesRepository = imagesRepository; }
internal Image <Gray, byte> CreateEmguCvImage(byte[] image, ImageMetrics metrics) { return(new Image <Gray, byte>(metrics.Width, metrics.Height) { Bytes = image }); }
// 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); }
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)); }
//SurfaceImg to EmguCV Img private Image<Gray, byte> CreateEmguCvImage(byte[] image, ImageMetrics metrics) { return new Image<Gray, byte>(metrics.Width, metrics.Height) { Bytes = image }; }
//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; }