Create an image with randomly positioned, diffraction-limited spots with full data on actual spot positions and parameters. Useful for testing a spot finding algorithm.
im_sz = two column vector specifying the size (rows,columns) of the output image.
num_spots = integer value number of spots to appear in the image.
Iout = full output image, with spots and noise according to all specified parameters.
Inoise = only the noise that appears in Iout.
The output 'spot_data' is a structure array with fields:
spot_data.Xcent(i) = x-center of the Gaussian spot i.
spot_data.Ycent(i) = y-center of the Gaussian spot i.
spot_data.ints(i) = peak height (intensity) of the Gaussian spot i.
spot_data.stds(i) = peak width (STD) of the Gaussian spot i.
length(spot_data.Xcent) = number of spots
The possible field entries are:
'spot_pos' is an optional specification of where the spots should occur in the image. The input should be a two column matrix of X and Y positions. Regardless of the value of 'num_spots', the script will use: num_spots = length(X).
'noise_mu' (-Inf < noise_mu < Inf) is the mean intensity of Gaussian noise in the output image. The default value is 0.
'noise_std' (0 < noise_std < Inf) is the standard deviation of the Gaussian noise in the output image. The default value is 0.
'int_mu' (0 < int_mu < Inf) is the mean spot intensity. The default value is 1.
'int_std' (0 < int_std < Inf) is the standard deviation in spot intensity. The default value is 0.
'wid_mu' (0 < wid_mu < Inf) is the mean width of the spot intensity distribution. The default value is 4.
'wid_std' (0 < wid_std < Inf) is the standard deviation in the widths of the spot intensity distributions. The default value is 0.
'plot' with value 1 will produce an output plot of Iout with the spot centers marked by red circles.
%More Complex Example:
%Specified Position Example:
%write to 8 bit output image:
Thank you for this, very helpful
i am sorry to put you in trouble. i myself figured it out how to do that. i had not checked the imwrite function at that time.
thank you sir for your beautiful code. it will help me a lot in my project.
i am new to the matlab. i am doing a similar project. this program was very helpful to me. while running the examples given above by you. i am getting the spots enclosed with red circles. i want the image as it is but without the red circle. i did some modification with your code but i couldn't find any solutions to my problem.
so i request yo to kindly help me to get the spots but without red circles enclosing the spot.