コード例 #1
0
        //Bitmap Image { get; set; }

        //public ImageBasedPSFGenerator(Bitmap image)
        //{
        //    Image = image;
        //}

        public PSFDescription GeneratePSF(int maxRadius)
        {
            PSFDescription desc = new PSFDescription();

            desc.deltasByRadius = new Delta[maxRadius + 1][];
            for (int radius = 0; radius < maxRadius + 1; radius++)
            {
                List <Delta> deltas = new List <Delta>();

                // scale the original image to size [2*radius; 2*radius]

                //

                // for each X
                //   for each Y
                //     compute derivative approximation (X difference)
                //     if (diffX != 0)
                //       add a new delta

                //deltas.Add(new Delta(-radius, 0, 1));

                desc.deltasByRadius[radius] = deltas.ToArray();
            }
            return(desc);
        }
コード例 #2
0
        /// <summary>
        /// Generate PSF deltas for radii [0; maxRadius]
        /// </summary>
        /// <param name="maxRadius"></param>
        /// <returns></returns>
        public PSFDescription GeneratePSF(int maxRadius)
        {
            PSFDescription desc = new PSFDescription();
            desc.deltasByRadius = new Delta[maxRadius + 1][];
            for (int radius = 0; radius <= maxRadius; radius++)
            {
                Bitmap psfImage = CirclePSFGenerator.CreateCircle(radius, SmoothingMode.None);

                List<Delta> deltas = DiffHorizontally(psfImage, radius);
                desc.deltasByRadius[radius] = deltas.ToArray();
            }
            return desc;
        }
コード例 #3
0
        /// <summary>
        /// Generate PSF deltas for radii [0; maxRadius]
        /// </summary>
        /// <param name="maxRadius"></param>
        /// <returns></returns>
        public PSFDescription GeneratePSF(int maxRadius)
        {
            PSFDescription desc = new PSFDescription();

            desc.deltasByRadius = new Delta[maxRadius + 1][];
            for (int radius = 0; radius <= maxRadius; radius++)
            {
                Bitmap psfImage = CirclePSFGenerator.CreateCircle(radius, SmoothingMode.None);

                List <Delta> deltas = DiffHorizontally(psfImage, radius);
                desc.deltasByRadius[radius] = deltas.ToArray();
            }
            return(desc);
        }
コード例 #4
0
        //Bitmap Image { get; set; }
        //public ImageBasedPSFGenerator(Bitmap image)
        //{
        //    Image = image;
        //}
        public PSFDescription GeneratePSF(int maxRadius)
        {
            PSFDescription desc = new PSFDescription();
            desc.deltasByRadius = new Delta[maxRadius + 1][];
            for (int radius = 0; radius < maxRadius + 1; radius++)
            {
                List<Delta> deltas = new List<Delta>();

                // scale the original image to size [2*radius; 2*radius]

                //

                // for each X
                //   for each Y
                //     compute derivative approximation (X difference)
                //     if (diffX != 0)
                //       add a new delta

                //deltas.Add(new Delta(-radius, 0, 1));

                desc.deltasByRadius[radius] = deltas.ToArray();
            }
            return desc;
        }