MATLAB: Reconstruct Gaussian fitted Beads

curve fittinggaussian fittingimage processingImage Processing Toolboximage reconstruction

I have gaussian fitted a bead in an image and I have its x & y coordinate, standard deviation (std) of the gauss fit as well as amplitude (amp). Is there a way to reconstruct the bead from the x,y,std & amp values?

Best Answer

Try this:
grayImage = zeros(480, 640, 'uint8');
[rows, columns] = size(grayImage);
xCenter = 200;
yCenter = 300;
sigma = 50;
sigmaSquared = sigma^2;
amplitude = 255;
[X, Y] = meshgrid(1:columns, 1:rows);
grayImage = exp(-((X-xCenter).^2 + (Y-yCenter).^2) ./ sigmaSquared);
imshow(grayImage, []);
axis on