Changes

Jump to navigation Jump to search
no edit summary
Line 89: Line 89:  
[[Image:Screenshot.png|center|Matlab code used for image analysis]]
 
[[Image:Screenshot.png|center|Matlab code used for image analysis]]
   −
The first line imports the image, in this case IMAG0001.jpg, converts it to a matrix, and separates the green channel.  Next, this matrix is imaged in false color in terms of intensity from blue(low) to red(hgh).  
+
This program imports images with the name beginning with fnameref, starting with fnameref-initial.bmp . The program then converts the image into a matrix of intensity values and separates out the green channel.  It then fits the intensity value to a Gaussian (called as gauss2(n,m,par)) and uses this fit to find the center of the image flare.  Since it is possible for the flare spot to be located outside the frame of the image, several checks are performed to ensure that the location which the program concludes is plausible.  If not, the program notes the check failure in a vector known as badvec (originally a vector of all 1’s) by placing a 0 at the cell corresponding to number of the failed fit.
 +
 
 +
The Gaussian fit program which searches for the flare center is the following:
   −
The last line is the actual search function. The search functions by finding the location with the smallest difference between the intensity(a(m,n)) and the fit function we apply to image.  We use a gaussian distribution with user defined parameters as our fit.  The code for this function is:
   
    
 
    
 
The parameters p(1) to p(6) are, in numerical order, (1) the amplitude of the function, (2) x location, (3)sigma x, (4) y location, (5) sigma y, and (6) an offset applied to eliminate background noise.  The function takes user inputs as an initial guess, then loops the search process to find more accurate values for the parameters.  Arbitrary values are chosen for p(1), p(3), p(5) and p(6) to begin, and are then readjusted based on the first output parameters.  Typically, the closer these fit parameters are to the true parameters, the better the function is at defining p(2) an p(4).
 
The parameters p(1) to p(6) are, in numerical order, (1) the amplitude of the function, (2) x location, (3)sigma x, (4) y location, (5) sigma y, and (6) an offset applied to eliminate background noise.  The function takes user inputs as an initial guess, then loops the search process to find more accurate values for the parameters.  Arbitrary values are chosen for p(1), p(3), p(5) and p(6) to begin, and are then readjusted based on the first output parameters.  Typically, the closer these fit parameters are to the true parameters, the better the function is at defining p(2) an p(4).
196

edits

Navigation menu