Matlab-Arduino-PC Synchronisation
Hello to all of you!
I am doing my master's final project which consists of a laser camera vision system to reconstruct objects of revolution. The main idea is that the camera (bfs-pge-16s2c-cs) sends an output signal through line 1 when ExposureActive is LOW (not capturing). If the arduino receives this signal, it takes a step with a stepper motor and sends a signal back to the camera through line 0 (trigger). Using SpinView, I have been able to verify that this works perfectly and I can get the exact captures I need for the movement of the motor with the idea of being able to reconstruct later knowing the angle between step and step.
My problem comes when I try to implement the saving with Matlab. I don't intend to use the trigger software with Matlab from the PC, but I would like Matlab to just send the signal to the arduino to start the cycle and Matlab gets ready to receive all the images and, once finished, save them in a specific location. I have a function that configures all the camera parameters and another one to do some tests and get captures via software trigger. I have been able to check that these two functions are working correctly. The part of the code that for the moment I have implemented to collect the images in Matlab is as follows
start(FLIR);
contadorImagenes = 0;
numero_imagenes = 360;
while contadorImagenes < numero_imagenes
if FLIR.FramesAvailable > 0
imagenes{i} = getdata(FLIR, 1, 'uint16');
contadorImagenes = contadorImagenes + 1;
end
pause(0.1);
end
It doesn't seem to be working as expected. I was wondering if anyone had any experience in a similar situation or should I give up and just trigger the camera via software and ask the engine to move a step through the serial port (although this seemed to be quite slow and inefficient).
Thanks to all
-
Hi Adrián,
We would not be able to provide assistance regarding third party software issues; we would recommend contacting MathWorks for additional support.
0 -
Hi Adrian,
I was just checking in if you got your Matlab code working?
We do not know enough about the Matlab functions to say how to grab and save images as you want, but we can help with any camera setting questions. It sounds like Spinnaker works fine, so you know the camera settings to set up to accomplish what you need.
Please let us know if you managed to get this working or not, and we can do our best to help you out.
Thank you,
Demos0 -
Hello,
I didn't get a good result with Matlab, but Spinview was able to collect all the photos. I think it would be very interesting to work on this topic because, in this way, a much more automated program could be made. I also tried with Python but without any results.
The problem is that the functions are oriented to trigger the camera by software, but Spinnaker is not prepared to save the images that the camera sends by hardware.
Do you think an update would be possible in the future?
Thanks
Regards
0
Please sign in to leave a comment.
Comments
3 comments