imganalysis by ajizai


									  Status of the ATLAS Muon
   Spectrometer Alignment
Rasnik Image Analysis Upgrade

       Marc Kea, 2-7-2007
    (Short) Introduction to Rasnik

             LED with                  Pixel sensor
             coded mask
             (see next slide)

   Rasnik: a 3-point alignment system for
    the ATLAS muon spectrometer
   Relative displacements between the three
    components can cause:
    • A translation
    • A scaling
    • A rotation
    of the image on sensor
             The Rasnik coded mask
                                                     ‘in phase’ with
‘pivot square’,                                      pattern: bit = 0
indicates                                             ‘counter-phase’
crossing of                                           to chessboard
horizontal &                                          pattern: bit = 1
codeline,                                              Position of this
contains no                                            codeline:
code info                                              ‘00100010’ =
                                                       34 blocks
                                                       vertically above

       Consists of a fine chessboard pattern (chromium on glass),
        block size typically 120µm
       To ensure a large dynamic range, every 9 lines and
        columns contains an 8-bit binary code which gives the
        vertical and horizontal ‘coarse’ positions, respectively
       Camera (4.7x3.5 mm) only ‘looks’ at a small portion of the
        mask (20x40 mm)
Purpose of the Rasnik Image Analysis

    Find rotation of the mask on sensor
    Find the scale (block size on sensor /
     true block size)
    Find the x- and y coordinate in the
     mask system of a reference pixel of
     the camera system
               What is attainable?
   Cramer-Rao lower bound (CRLB) for shift estimation gives a lower
    limit for resolvable translations for a given image

                2                                2
         2      noise                     2      noise
         x           2                    y          2
               dI                               dI
               dx                               dy
   -> Lower bound of resolution proportional to noise level in image
    and inversely proportional to the gradient energy in translation
   For a sharp short-range rasnik image (e.g. from a praxial
    CRLB ≈ 10nm
   For a long range (e.g. projective) system:
    CRLB ≈ 100nm
   This is a lower bound, any implementation will have a lower
    (Very Short) Description of the
    Current Rasnik Image Analysis

   Gradient based (edge detection)
    method for finding the fine shift of
    the chessboard pattern
   Intensity based (thresholding)
    method for determining the bit value
    of the codebits
     Current Rasnik image analysis

                   Gradient in x of a Rasnik image

    Line-fitting algorithm fits lines to gradx
     and grady to determine scale, rotation and
     fine translation in x and y

(image taken from Kevan Hashemi’s Rasnik analysis page
    Current Rasnik Image Analysis
   Fine translations in x and y, rotation and
    scale can now be used to compare the
    intensity of each code square to its
    neighbors (thresholding) to determine its
    bit value
   Now each codebit has to be judged for
    reliability; codebits can be obstructed by
    dust, cables, etc. etc.
   Be wary of ‘wrong’ code readings: a wrong
    answer is far worse than no answer
   Final x and y position = coarse (code)
    shift + fine shift
                 2D FFT
   Computes a 2D spectrum of the
    spatial frequencies and their phase in
    an image
   2D FFT: compute and put back the
    1D FFT of each row in an image,
    then compute and put back the FFT
    of each column of the resulting
      2D FFT and Rasnik

        X                       =

             Spatial domain
2D                                  2D
FFT          (multiplication)       FFT

        *                       =

            Frequency domain
       Spectrum of a real Rasnik image
Lower frequency
region:                DC term
background light                 First harmonics
variations, large
dust, codebits
                                   (the sharper
Higher                             the image,
frequency                          the more
variations                         higher
(noise, fine                       harmonics!)


     Recovering rotation, scale,
  translation in the Fourier domain
Operation in Spatial                   Fourier
spatial      domain                    domain
Rotation     f’(x,y)=f(xcosθ + ysin θ, F’(ω , ω ) =
             ycosθ - xsin θ)
                                                   x   y
                                       F(ω cosθ + ω sin θ,
                                                   x           y
through θ                              ω cosθ - ω sin θ)
                                               y           x

Scaling by a,b       f’(x,y) = f(ax,by)       F’(ωx, ωy) = (1/|a||b|) *
                                              F(ωx/a, ωy/b)

Translation by       f’(x,y) = f(x-x0,y-y0)   F’(ωx, ωy) = exp(-i(ωx
                                              x0 + ωy y0)) F(ωx, ωy)
           In practice:


Translation (within one period of main harmonic)
obtained from phase of first harmonics
   Select centre 256*256 pixels (for now)
   Apply windowing function to reduce edge
   Perform 2D FFT
   Find spectral main harmonic peaks
   Fit main harmonic peaks
   Look for second harmonics, if they contain
    enough signal power fit them also
   From this, determine scale, rotation
   Find accompanying phase and thus fine
   Use this as input for codeline reading!
     Progress of implementation
   Algorithm to find rotation, scale, fine translation
   In simulations (SNR = 10, rasnik image
    simulated with 2D sinefield):
    • Resolution in rotation: 10^-4 rad
    • Resolution in scale: 10^-4
    • Resolution in translation: 10^-4 period (corresponds to
      approx. 50nm)
   HOWEVER a real Rasnik image is not a 2D
    sinefield! More testing will be done using images
    from an ultrastable test bench
   Algorithm to find and read codelines
    implemented, but easily disrupted by dust,
    obstructions, etc. Far less than ideal at the
   Kevan Hashemi (Brandeis) image analysis routine
    for the endcap muon spectrometer has been tried
    and tested for years, proven to be very robust

   Agreed to look into integrating initial fine shift
    calculation using 2D FFT with Kevan’s analysis,
    perhaps even standardising the combined
    analysis for use both in the endcap and barrel

   Thanks to Pierre-Francois Giraud the integration
    of Pascal and c++ will be possible
                    To do
   Combine fine and coarse shift routines
   Do testing on stable test-bench images to
    compare new and old analyses
   Run the new analysis on a single line in
    ATLAS (infrastructure for this is ready
    thanks to Robert Hart)
   If all goes well, implement the new
    analysis on lines which cannot be analysed
    using the old analysis
   And then in the entire barrel muon
Bonus: other elegant stuff

    2D                         2D
    FFT                        IFFT

   Filter: keep boxed part, discard rest

     2D                          2D
     FFT                         IFFT

To top