Trigger camera at evenly spaced times
Show older comments
I have a USB camera and I am trying to acquire images at a certain frame rate. However, for this particular camera (Thorlabs DCC1545M) when I use the get() command, FrameRate is not shown as a parameter I can change.
Since I can't change the frame rate directly, I am trying to figure how how I can trigger it to acquire a single image every XX seconds. I'm aiming for a frame rate of 460, so XX ~ 2.3 ms. InitialTriggerTime is read only and since the default frame rate is lower than I want, I can't just skip a certain number of frames. I know the camera is capable of this frame rate using a ROI.
Does anyone have any suggestions?
1 Comment
Hilton
on 15 Oct 2013
Hi Laura,
How did you manage to make Matlab to recognize your camera (Thorlabs DCC1545)?
Answers (2)
Geoff
on 19 Apr 2012
It apparently comes with an SDK. If you know C, it's pretty trivial to MEX up a simple wrapper to setup the ROI and frame rate.
There are some relevant API calls:
is_AOI()
is_SetFrameRate()
is_SetExposureTime()
Apparently you can interface with VB / ActiveX. This might be easier to do via MatLab, especially if you are not familiar with C.
As for your snapshot idea, I would be very surprised if you could set up a reliable trigger to snapshot an image 460 times a second.
6 Comments
Laura
on 20 Apr 2012
Geoff
on 22 Apr 2012
Nah, if you're not a C programmer it will be a frightful exercise. You could maybe look at using the ActiveX interface. This might help: <http://www.codeproject.com/Articles/5848/Using-ActiveX-Control-Inside-MATLAB>.
Tuning a camera device for high frame rates generally requires some lower-level control. I've never done this in MatLab so I am probably not the one to answer your question.
Saying that, it might be possible with your method. What are the properties of your video object? If you go: set(vid) on its own, what comes up? If not frame rates etc, do you get a pixel clock? I wonder also if there's a device you can specify other than 'winvideo'. Does the 'imaqhwinfo' command show any other devices?
Another method I've used on cameras in the past is to use software that came with the cameras to set up the image properties, frame rate etc. Some cameras will allow this, by retaining their most recent state after reconnecting with a different client (ie MatLab).
Laura
on 22 Apr 2012
Image Analyst
on 22 Apr 2012
So it looks like Thorlabs doesn't have a custom adapter written especially for MATLAB, so you'll have to do everything the SPI/SDK, unless you're happy with the winvideo adapter. But winvideo won't let you do specialized, custom things with your camera like the SDK will. It's possible they do have a special MATLAB adapter but you have to download it from their web site - it's worth asking them.
ichi
on 3 May 2014
Hi everyone, I have problem, how to run Thorlabs camera on matlab: I installed camera’s driver and package & Microsoft Visual C++ (2005/2008/2010 redistributed edition), but i can’t connect the camera to matlab. What is routine way to run these codes? We use matlab 2011a, a thorlabs DCC1545M camera (USB2), and want to capture image in matlab or maybe have live view. It is essential to control camera parameters. I would be thankful for any helps.
Phong Phan
on 10 Apr 2015
Ichi , have you figured out how to connect the camera to malab , your help would be really appreciated !!
Phong
Image Analyst
on 22 Apr 2012
0 votes
Laura: the free run frame rate for your camera at 1280x1024 pixels is 25 frames per second. I think the only way you can get up to 460 frames per second, if it's even possible (which it may not be), is to grab a smaller chunk of the CMOS sensor. That's usually how cameras go to higher frame rates than the free run frame rate. 460 fps is fairly high unless you have a special high speed camera.
I don't know if this camera has a MATLAB adapter written for it - they are usually written by the camera manufacturer. If it does, the image matrix size and frame rate may or may not be an exposed property or method that you can adjust. If they aren't you'll have to make API calls to the SDK. Hopefully the manufacturer can help you with that.
1 Comment
Geoff
on 22 Apr 2012
I would expect a resolution of about 300x200 at 460fps. Hopefully there is a pretty big lens attached to this camera, or some really good lighting.
Categories
Find more on National Instruments Frame Grabbers in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!