Discussion:
Laser Beam Profiling using Matlab
(too old to reply)
LSci
2008-10-23 15:13:43 UTC
Permalink
Raw Message
Recently, we used a vendor-supplied software package (BeamStar) to
collect ~200 laser beam profiles in video format. However, now that
we have gone back and tried to post-process the files in BeamStar, it
will not let us change critical length and power calibration
parameters, nor let us subtract the background. This is a rather
large stumbling block, as we are trying to measure the beam width and
beam power with accuracy. (Warning to others -- never use BeamStar if
you want to do post-processing)

So, we are working on converting our files stored in the proprietary
BeamStar format to uncompressed .avi files, and then purchase a copy
of Matlab to measure the beam parameters from the .avi files. I was
hoping to find an m-file for beam analysis, but my searches on the web
and in textbooks have not turned up anything yet. So, it looks like
if we go this way, I will be doing it from scratch.

Here is the process as I see it:
1. Take the individual frames from the .avi file and separate them
into individual files.
2. Subtract off the background file.
3. Compute the centroid of the image (hopefully the beam centroid).
4. Define a "Region of interest" around the centroid (hopefully
circular or elliptical, though a square might do).
5. Compute the integrated energy in this region of interest (hopefully
the total beam power).
6. Measure the beam diameter in x and y directions in different ways,
such as fitting a 2-D Gaussian, computing a 90/10 beamwidth, etc...

Basically I am re-inventing the "beam profile measurement" wheel in
Matlab. Further, the last time I really used Matlab was years ago,
but I'm getting stuck with the assignment because that is more than
anybody else in our group.

So, if anyone has any suggestions on whether to use Matlab or some
other product, I would appreciate it. Also, if anyone has any
suggestions on how to define a non-square region of interest, or how
to easily perform the beam diameter measurements, I would appreciate
it.

Thanks.
Rune Allnor
2008-10-23 16:24:22 UTC
Permalink
Raw Message
Post by LSci
Recently, we used a vendor-supplied software package (BeamStar) to
collect ~200 laser beam profiles in video format.  However, now that
we have gone back and tried to post-process the files in BeamStar, it
will not let us change critical length and power calibration
parameters, nor let us subtract the background.  This is a rather
large stumbling block, as we are trying to measure the beam width and
beam power with accuracy. (Warning to others -- never use BeamStar if
you want to do post-processing)
So, we are working on converting our files stored in the proprietary
BeamStar format to uncompressed .avi files, and then purchase a copy
of Matlab to measure the beam parameters from the .avi files.  I was
hoping to find an m-file for beam analysis, but my searches on the web
and in textbooks have not turned up anything yet.  So, it looks like
if we go this way, I will be doing it from scratch.
1. Take the individual frames from the .avi file and separate them
into individual files.
Use function AVIREAD to read individual frames.
Post by LSci
2. Subtract off the background file.
Trivial, given a background file.
Post by LSci
3. Compute the centroid of the image (hopefully the beam centroid).
This is where one might see problems: Are the data
represented 'raw' in the file or do they suffer from
compression / quantization effects?
Post by LSci
4. Define a "Region of interest" around the centroid (hopefully
circular or elliptical, though a square might do).
Image processing can give all sorts of statistics;
maybe (n,m) correlation lengths can be used?
Or eigenvectors/eigenvalues of the (n,m) autocorrelation
function?
Post by LSci
5. Compute the integrated energy in this region of interest (hopefully
the total beam power).
Depends on calibrations, as well as compression
effects as already noted.
Post by LSci
6. Measure the beam diameter in x and y directions in different ways,
such as fitting a 2-D Gaussian, computing a 90/10 beamwidth, etc...
Basically I am re-inventing the "beam profile measurement" wheel in
Matlab.  Further, the last time I really used Matlab was years ago,
but I'm getting stuck with the assignment because that is more than
anybody else in our group.
So, if anyone has any suggestions on whether to use Matlab or some
other product, I would appreciate it.
From a purely technical proint of view, matlab
seems to be up to the job. Any severe problems
(not related to user skills or experience) are
concerned with data integrity in the AVI files.
If those files contain data with the technical
standard required to do the job, this seems to
be possible by means of matlab.

Rune
LSci
2008-10-28 02:32:35 UTC
Permalink
Raw Message
Post by Rune Allnor
This is where one might see problems: Are the data
represented 'raw' in the file or do they suffer from
compression / quantization effects?
-----------------------
This is the sticking point for us right now. Our data is in a vendor-
specific format, *.oor. An associate adapted a program to rip the 16
bit monochrome data to a 24-bit color *.avi. So, while we don't lose
data on the compression, we do lose bit depth since it converts the
~10 bit input to 8 bit red. We need to change the program to keep it
in 16-bit monochrome format. Spiricon has told us that they would
work on getting some way of ripping these files, but so far they have
not given us anything. So, it is still a work in progress, but so far
we have not had data loss due to compression.
Post by Rune Allnor
Post by LSci
4. Define a "Region of interest" around the centroid (hopefully
circular or elliptical, though a square might do).
Image processing can give all sorts of statistics;
maybe (n,m) correlation lengths can be used?
Or eigenvectors/eigenvalues of the (n,m) autocorrelation
function?
----------------

After some reading up, Matlab does have a "region of interest"
function that is able to do elliptical regions. My idea is to center
it on the centroid, then perhaps use some multiple of the average beam
width for the data set to define the region automatically. I will
probably end up cropping as much of the background as I can.
Post by Rune Allnor
Post by LSci
6. Measure thebeamdiameter in x and y directions in different ways,
such as fitting a 2-D Gaussian, computing a 90/10 beamwidth, etc...
After some checking around, the "standard" definition of beam width is
4-sigma, which just involves the computation of a centroid, and
standard deviations in each direction. So, it should be decently easy
to do in Matlab, even though I couldn't find a built-in function.
Post by Rune Allnor
From a purely technical proint of view, matlab
seems to be up to the job. Any severe problems
(not related to user skills or experience) are
concerned with data integrity in the AVI files.
If those files contain data with the technical
standard required to do the job, this seems to
be possible by means of matlab.
Rune
Thanks again for all the help. I really appreciated it. Of course,
after I got the quote on a single seat of Matlab, the price left me
wondering whether I could make it work in Scilab or Octave. ;)

I'll be sure and post whatever beam diagnostic functions and methods I
develop.

LSci
h***@gmail.com
2017-11-17 15:58:09 UTC
Permalink
Raw Message
Post by LSci
Post by Rune Allnor
This is where one might see problems: Are the data
represented 'raw' in the file or do they suffer from
compression / quantization effects?
-----------------------
This is the sticking point for us right now. Our data is in a vendor-
specific format, *.oor. An associate adapted a program to rip the 16
bit monochrome data to a 24-bit color *.avi. So, while we don't lose
data on the compression, we do lose bit depth since it converts the
~10 bit input to 8 bit red. We need to change the program to keep it
in 16-bit monochrome format. Spiricon has told us that they would
work on getting some way of ripping these files, but so far they have
not given us anything. So, it is still a work in progress, but so far
we have not had data loss due to compression.
Post by Rune Allnor
Post by LSci
4. Define a "Region of interest" around the centroid (hopefully
circular or elliptical, though a square might do).
Image processing can give all sorts of statistics;
maybe (n,m) correlation lengths can be used?
Or eigenvectors/eigenvalues of the (n,m) autocorrelation
function?
----------------
After some reading up, Matlab does have a "region of interest"
function that is able to do elliptical regions. My idea is to center
it on the centroid, then perhaps use some multiple of the average beam
width for the data set to define the region automatically. I will
probably end up cropping as much of the background as I can.
Post by Rune Allnor
Post by LSci
6. Measure thebeamdiameter in x and y directions in different ways,
such as fitting a 2-D Gaussian, computing a 90/10 beamwidth, etc...
After some checking around, the "standard" definition of beam width is
4-sigma, which just involves the computation of a centroid, and
standard deviations in each direction. So, it should be decently easy
to do in Matlab, even though I couldn't find a built-in function.
Post by Rune Allnor
From a purely technical proint of view, matlab
seems to be up to the job. Any severe problems
(not related to user skills or experience) are
concerned with data integrity in the AVI files.
If those files contain data with the technical
standard required to do the job, this seems to
be possible by means of matlab.
Rune
Thanks again for all the help. I really appreciated it. Of course,
after I got the quote on a single seat of Matlab, the price left me
wondering whether I could make it work in Scilab or Octave. ;)
I'll be sure and post whatever beam diagnostic functions and methods I
develop.
LSci
Any luck LSci?

-Henry

Loading...