As I had hoped this week gave us a little more work to do rather than just research and look up information. Last Friday afternoon (after our burgers and frisbee game) Professor Buma showed us a prototype of a microscope. He said it looked pretty ugly but I thought it was pretty cool. It was battery charged with a laser which, through various lenses, he made into a point source of light. Then there was a place to put a slide and also a handy tool to move the slide horizontally with great precision. On the other side of the slide there was a webcam (or at least part of one) which acted as our ‘detection plane.’ We used a webcam for that part because it can take pictures which can be immediately transferred to the computer and it was readily available. Although we didn’t get a chance to play around with the microscope then I’m sure we’ll have plantly of practice in the weeks to come.
This week started off with a Dunkins Donut breakfast which gave us all a chance to catch up with each other and hear about other projects. After that Professor Buma sent us a MATLAB code which produced 16 frames of the same 3 objects from different positions. The objects were just two dimensional squares in the xyz coordinate system. There were two squares in the same z=3.5 plane and and a third in the z=2.5 plane. The different pictures or frames were images of projections of the pointsource traveling along the x-axis and projecting images of the 3 squares on a dection plane which laid at z=20. We knew the position and size of each of the squares, the postion of the detection plane, and the 16 different position of the source along the x-axis.
Although it sounds kind of complicated, the program was pretty straight forward and produced 16 frames of these 3 squares. The squares seemed to travel across the image in each of the consectutive squares because of the shifting source. When Allan and I first got the code we just played around with it and tried to figure out how it worked and tried to visualize what was going on. After we understood that program well enough we had to try to make our own code that would combine the images to one image that would represent the actual object.
This seemed like a daunting task at first. We had the images and we also knew what the final image should look like (two seperate images would be produced, one of the z=3.5 plane and one of the z=2.5 plane) however the inbetween steps proved to be problematic. Both Allan and I worked on this program using the shift-and-add method but we worked seperately to both get the experience. The shift and add method is just as it sounds, you shift the images individually and then add the shifted images together to get the finished product. After a lot of searching, trial and error, and looking through MATLAB Help both Allan and I found (seperately) the same functions we needed to use; the imadd and the circshift functions.
Once we knew which functions to use it was up to us to figure out how to use them. My first approach was very specific to this problem. However to get this code to work I had to count the pixels the square moved from frame to frame, a tedious process. For the other two squares I had to do the same thing (in a seperate code) so once I got a code to work and produce decent images, I went back and tried to improve my code. This morning I finally got my code to work even better and in a more general manner. Instead of hardcoding the shift of each frame into the code, I used information that I knew would be available to us in future experiment: the distance to the detector and the distance to the object. However after we met with Professor Buma he informed us that we would not nessecarily know the distance to the object. So that is the task at hand now. Make another program like what we just did but even more general so it will work on any z plane. Great.