Example #1
0
        /// <summary>
        /// Stitches the images provided to a new image with next best square size.
        /// {1, 2}         {1, 2, 3}             {1, 2, 3, 4, 5 }
        /// produces the image
        /// 1               1 2                   1, 2, 3
        ///                 3 X                   4, 5
        /// The color format of all images must be equal and have byte format.
        /// </summary>
        /// <param name="images">The image array that should be stitched.</param>
        /// <returns>Stitched image</returns>
        public static PixImage StitchSquare(this PixImage[] images)
        {
            var squareSize = (int)Fun.Ceiling(images.Length.Sqrt());
            var array      = new PixImage[squareSize][].SetByIndex(
                row => new PixImage[squareSize].SetByIndex(
                    col => { var ii = squareSize * row + col; return(ii < images.Length ? images[ii] : null); }));

            return(array.Stitch());
        }
 /// <summary>
 /// Creates a Gaussian FilterKernel with given sigma.
 /// Radius is set to 3 * sigma.
 /// </summary>
 public static Vector <float> Gaussian1(float sigma)
 {
     return(Gaussian1(sigma, (int)Fun.Ceiling(3 * sigma)));
 }
 /// <summary>
 /// Creates a Gaussian FilterKernel with given sigma.
 /// Radius is set to 3 * sigma.
 /// </summary>
 public static Matrix <float> Gaussian2(float sigma)
 {
     return(Gaussian2(sigma, (int)Fun.Ceiling(3 * sigma)));
 }