public IImageBuffer RenderThumbnail(IImageBuffer image)
        {
            IImageBuffer resizedImage = null;

            if (image.Width == 0 || image.Height == 0)
            {
                return(I.CreateRgbF32(0, 0));
            }

            Int2    size;
            IntRect cropRect;

            base.CalculateNewSize(new Int2(image.Width, image.Height), this.DesiredSize, out size, out cropRect);
            if (image.Width <= size.X && image.Height <= size.Y)
            {
                return(image);
            }

            resizedImage = image.ToF32().Resize(size, cropRect, ResizeFilterType.Quadratic);
            var f32image = resizedImage as I <float>;

            if (f32image != null)
            {
                return(f32image.ToU8());
            }

            return(resizedImage);
        }
Example #2
0
 public I <float> Crop(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] IntRect area
     )
 {
     return(image.ToF32().Crop(area));
 }
 public int[][] CreateHistogramm(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] int bins
     )
 {
     return(image.ToF32().CreateHistogram(bins));
 }
 public I <float> Equalize(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] int bins
     )
 {
     return(image.ToF32().HistogramEqualization(bins));
 }
Example #5
0
 public I <float> Filter(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] double weight
     )
 {
     return(image.ToF32().FastDoGFilter(weight));
 }
 public int[] CreateChannelHistogram(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] int bins,
     [InputPin(PropertyMode = PropertyMode.Default)] int channel
     )
 {
     return(image.ToF32().CreateChannelHistogram(bins, channel));
 }
 public I <float> Equalize(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] int channel,
     [InputPin(PropertyMode = PropertyMode.Default)] int bins
     )
 {
     return(image.ToF32().EqualizeSingleChannel(channel, bins));
 }
Example #8
0
 public I <float> Filter(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] double weight,
     [InputPin(PropertyMode = PropertyMode.Default)] double scaling
     )
 {
     return(image.ToF32().FastDivisionFilter(weight, scaling));
 }
Example #9
0
        public I <float> ConvertColor(
            IImageBuffer image,
            [InputPin(PropertyMode = PropertyMode.Default)] ColorSpaceConversionType conversion
            )
        {
            var converter = GetConverter(conversion);

            return(converter(image.ToF32()));
        }
Example #10
0
 public I <float> Filter(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] int matrixSize,
     [InputPin(PropertyMode = PropertyMode.Default)] double weight,
     [InputPin(PropertyMode = PropertyMode.Default)] double scaling
     )
 {
     return(image.ToF32().DivisionOfGaussianFilter(matrixSize, weight, scaling));
 }
Example #11
0
 public I <float> Filter(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] int width,
     [InputPin(PropertyMode = PropertyMode.Default)] int height,
     [InputPin(PropertyMode = PropertyMode.Default)] ResizeFilterType resizeFilterType = ResizeFilterType.Lanczos8
     )
 {
     return(image.ToF32().Resize(new Int2(width, height), resizeFilterType));
 }
Example #12
0
        public IEnumerable <I <float> > Split(IImageBuffer image)
        {
            var img = image.ToF32();

            for (int c = 0; c < img.Channels; ++c)
            {
                yield return(img.GetChannel(c));
            }
        }
Example #13
0
 public I <float> EqualizeAdaptive(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] int bins,
     [InputPin(PropertyMode = PropertyMode.Default)] int numTilesY,
     [InputPin(PropertyMode = PropertyMode.Default)] int numTilesX,
     [InputPin(PropertyMode = PropertyMode.Default)] double normalizedClipLimit
     )
 {
     return(image.ToF32().AdaptiveHistogramEqualization(bins, numTilesY, numTilesX, normalizedClipLimit));
 }
Example #14
0
 public int[] CreateChannelHistogramOfRect(
     IImageBuffer image,
     [InputPin(PropertyMode = PropertyMode.Default)] int startRow,
     [InputPin(PropertyMode = PropertyMode.Default)] int startCol,
     [InputPin(PropertyMode = PropertyMode.Default)] int height,
     [InputPin(PropertyMode = PropertyMode.Default)] int width,
     [InputPin(PropertyMode = PropertyMode.Default)] int bins,
     [InputPin(PropertyMode = PropertyMode.Default)] int channel
     )
 {
     return(image.ToF32().CreateChannelHistogramOfRect(startRow, startCol, height, width, bins, channel));
 }
 public IImageBuffer Calculate(IImageBuffer image1, IImageBuffer image2)
 {
     return(I.Divide(image1.ToF32(), image2.ToF32()));
 }
 public IImageBuffer Calculate(IImageBuffer image1, IImageBuffer image2)
 {
     return(I.Multiply(image1.ToF32(), image2.ToF32()));
 }
Example #17
0
 public I <float> ConvertDepth(IImageBuffer image)
 {
     return(image.ToF32());
 }
Example #18
0
 public I <float> Process(IImageBuffer image, [InputPin(PropertyMode = PropertyMode.Default)] double[] stepSize)
 {
     return(image.ToF32().Quantization(stepSize));
 }
Example #19
0
 public I <float> Scale(IImageBuffer image, [InputPin(PropertyMode = PropertyMode.Default)] Range <double>[] inRange, [InputPin(PropertyMode = PropertyMode.Default)] Range <double>[] outRange, [InputPin(PropertyMode = PropertyMode.Default)] double[] gamma = null)
 {
     return(image.ToF32().ScaleRanges(inRange, outRange, gamma));
 }
Example #20
0
 public I <float> Filter(IImageBuffer image)
 {
     return(image.ToF32().CenteringAroundMean());
 }
Example #21
0
 public I <float> Saturate(IImageBuffer image, [InputPin(PropertyMode = PropertyMode.Default)] double saturationFactor = 0.01, [InputPin(PropertyMode = PropertyMode.Default)] int bins = 500)
 {
     return(image.ToF32().AutoSaturate(saturationFactor, bins));
 }