40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  TCS elog  Not logged in ELOG logo
Message ID: 39     Entry time: Thu May 20 08:20:54 2010
Author: Aidan 
Type: Computing 
Category: Hartmann sensor 
Subject: Centroiding algorithm and code to generate simulated data 

 Here's a copy of an email I distributed today that describes the centroid and simulation code I wrote.

Hi Won,

I've written some code that generates an image of Gaussian spots and provides you with the coordinates of the centers used to generate those spots. There is the facility to turn on i) photo-electron shot noise, ii) random displacement of the nominal positions of the centers from a regular array and iii) 12-bit digitization to more accurately model the output from a CCD.

I've included an example routine that calls this function and then centroids those spots using a variant of your centroiding algorithm.

You should be able to use this to generate reliable simulated data to test versions of your centroiding algorithm.


Attached files: 
1. test_spot_generation_and_centroiding.m     - the example routine. Run this first
2. generate_simulated_spots.m         - the function to generate the simulated spots in an image and as a set of positions
3. centroid_image.m - the function to centroid an image

Attachment 1: test_spot_generation_and_centroiding.m  5 kB  | Hide | Hide all
% example usage of generate_simulated_spots and centroid_image

clear all
close all

%% example 1 - 
npixels = 1024;          % the number of pixels in the image
... 143 more lines ...
Attachment 2: generate_simulated_spots.m  6 kB  | Hide | Hide all
function output = generate_simulated_spots(npixels, digitizeFLAG, ...
                          IntensityNoiseFLAG, positionNoiseFLAG)
% a function to generate an image of spots to centroid and to provide the original 
% locations of the spots. 
% input
% -----
% npixels - pixels in output image
% digitizeFLAG:          0 - floating point array is output
... 160 more lines ...
Attachment 3: centroid_image.m  3 kB  | Hide | Hide all
function centroids = centroid_image(image, centroids)
% This function centroids a supplied image. It returns a centroids structure
% 'centroids' structure
% --------------------
% centroids.image_background_level  - the background intensity of an image
%                                     with no illumination on it
%          .spot_radius             - the radius of a hartmann spot
%          .spot_threshold_level    - the minimum intensity of pixels used to
... 95 more lines ...
ELOG V3.1.3-