03-26-2014 08:22 AM
In this text I will first explain the background of my project and then explain the problem. It might by a bit lengthy, but please bear with me.
My goal is to create a top-hat laser bundle. In order to achieve this, I have bought a DLP5500 DMD SLM from Texas Instruments. An SLM is a Spatial Light Modulator. There are several types of SLMs, such as Liquid Crystal SLMs, but also Micro Optical Electric Mechanical Systems (MOEMS). An example of this is a Digital Micromirror Device, or DMD. That's basically hundreds of thousands of tiny mirrors that you can set either on or off. I have bought such a device from TI: the DLP5500 model. It's 1024 by 768 mirrors (or pixels).
Our setup should do this: we shine with a beam on the DMD, which turns our quasi-Gaussian beam into a top-hat beam.
But for the DMD to do this correctly, it should have the right pattern loaded to it.
Because the mirrors are either 'on' or 'off', it can be seen as a 1024 x 768 image with a depth of 1 bit (on or off).
The beam profile that is measured by a CCD-camera however has a resolution of 1296 x 964 pixels with an image depth of 12 bit.
So my goal is to measure the beam profile, process it and turn it into a DMD pattern. The framerate with which new data can be loaded to the mirror is 60 Hz, so 60 new patters can be loaded per second.
My problem is this:
I want to scale the 1296 x 964 pixel images with 12 bit image depth of the CCD camera down to 1024 x 768 images with one bit image depth. The easiest way to do this is not through actual images, but by splitting the images into arrays, and then processing these arrays into the new one bit depth arrays.
But I do not know how to do this. To keep it simple, I first want to try it with just images, and then go to video.
So how do I turn a 1296 x 964 pixel image into a 1024 x 768 image without losing the information? I know this requires changing the aspect ratio, but how to achieve this, I do not know
Additional information and problem:
To calculate whether or not the mirror should be on or off, we compare it to our goal image: an eighth order Super Lorentzian.
An Super Lorentzian function looks like this: 1 / (1 + ([x/x0]^n) ).
Since it's an eighth order the n is an 8. This produces a top hat plot. This is our target.
So (maybe, I'll explain in a moment) we want an image of an ideal top-hat function with a resolution of 1024 x 768, 2 bit depth.
To prevent this text from becoming any longer, I'll skip right to the algorithm for this:
Our algorithm (only roughly sketched at the moment) looks at the value and says 'the pixel is larger/smaller than 0.5 so it must become a 1/0. This induces an error that must be corrected by taking the data that was thrown away into account for the calculation of the next pixels. The entire thing is then read out lexicographically (that means 'writing as you read', so from left to right).
We haven't decided yet if we want to have an picture of the Super Lorentzian in the system and then comparing our CCD input with that image, or calculating the value of the Super Lorentzian image per pixel as we process the image. The latter requires a bit of space on my computer, but we don't live in the 90s anymore so such an image is very small.
Whatever is the easiest to program is what we will stick with.
So my questions are: How do you turn a 1296 x 964 image into a 1024 x 768 image while also being able to process the image depth value through extensive calculations?
And:
What is easier to program: comparing one image to another or calculating the second image per pixel and then comparing it?
03-28-2014 09:19 AM
I succeeded into changing the resolution using the IMAQ property node function. I still haven't managed to get acces to the array that makes up the image or being able to process the pixels lexicographically. Does anybody have an idea how to do that?