Pulnix TMC-7DSP User Manual Page 7

  • Download
  • Add to my manuals
  • Print
  • Page
    / 32
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 6
6
NOTE! You have to wait a while (>0.5 seconds) after the camera initialization before you
acquire the image. Otherwise the picture will contain errors.
2. To acquire image data to MatLab workspace.
If the camera is initialized, use command
’Acquire’
to acquire image.
NOTE! Acquired data is at first in incompatible order in MatLab. You have to change the
dimensions of the data to be able to handle it as a RGB image. Therefore, use math-file
‘Acquire.m’ (or your own similar function) to acquire image, instead of just ‘FrameCapt’.
See below for details of ‘Acquire.m’.
3. To close camera.
You must close the camera before you exit MatLab. Otherwise you will lose the “camera
thread” and you have to reboot the computer to be able to access the camera again. To close
the camera, give a parameter (what ever, e.g. 0 or 1) for the command ‘FrameCapt’. For
example:
’FrameCapt(1)’
‘Acquire.m’ includes the following code:
%Capture frame
pict = FrameCapt;
%From 4x640x480 to 640x480x3
picture(:,:,1) = pict(3,:,:);
picture(:,:,2) = pict(2,:,:);
picture(:,:,3) = pict(1,:,:);
%From 640x480x3 to 480x640x3
newImage(:,:,1) = picture(:,:,1).';
newImage(:,:,2) = picture(:,:,2).';
newImage(:,:,3) = picture(:,:,3).';
newImage is now in compatible form for further image processing.
Problems during programming
Acquiring the data to MatLab was relatively easy. However, the picture did not seem to be right at
all at first. After going over the data I noticed that it was in wrong dimensions. The alpha channel
was always zero, so I was able to see the structure of the image from the data. Using MatLab’s
matrix operations I was able to find the right dimensions.
The other time consuming problem was solved really simply. The problem was that when I tested
my acquiring program, the resulting picture seemed to have errors. Only around every 20
th
picture
seemed to be ok. In my test program I initialized the camera, acquired the image, and closed the
camera. It turned out that I Acquired the picture too fast after the initialization of the camera.
Camera needs some time to “wake up”. After I added a delay before the acquisition, everything
went well.
The code for the program can be found in Appendix I and II.
Page view 6
1 2 3 4 5 6 7 8 9 10 11 12 ... 31 32

Comments to this Manuals

No comments