//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); }
/// <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; }
/// <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); }
//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; }