how to capture real time video through a camera that is connected to the PC through parallel port
3 views (last 30 days)
Show older comments
Hi! Can someone please tell me the code to capture real time video through a camera that is connected to the PC through parallel port?
0 Comments
Answers (2)
Walter Roberson
on 13 Dec 2015
Only if you are using Windows XP and a sufficiently old version of MATLAB, or if you are using the Data Acquisition Toolbox and your camera vendor supplied a VISA interface that is compatible with the 32 vs 64 bit version of MATLAB you are using.
Historically, the manufacture of cameras with parallel ports tended to coincide with 32 bit operating systems, and many did not make a 64 bit VISA driver available, leaving them usable only with 32 bit versions of MATLAB. That is a problem because R2015b (the current release) is the last 32 bit version of MATLAB.
Windows XP supported access to parallel ports in a reasonable manner. Windows Vista made it harder, and by the time Windows 7 came around, direct program access to parallel ports was no longer allowed for security reasons.
You might be able to find an ActiveX / COM control that would allow you to talk to the parallel port; you would likely have trouble making that work quickly enough for camera use to be feasible unless it was low frame rate and low resolution.
1 Comment
Walter Roberson
on 13 Dec 2015
You will need to use a version of MATLAB no later than R2015a, as R2015b and later do not support Windows XP, and parallel port access is not available under windows 7 or later (except by using VISA drivers or other such work-arounds.)
After you have created the digitalio object and added lines, you would use its methods to send and receive values, such as using getvalue(). Unfortunately there is no equivalent to the serial BytesAvailableFcn. You might want to create a timer callback to read the data but that is going to have tradeoffs; see http://www.mathworks.com/matlabcentral/answers/42110-pcie-6535-and-legacy-interface#answer_51863
Synchronizing with the camera and decoding the frames is going to be up to your code.
I would firmly recommend that you consider other equipment. At the very least see if the camera has a VISA driver, because if it does then you would be able to use the Instrument Control Toolbox for better I/O operations. Or if you could get a camera that supports Camera Link, GigE Vision, or DCAM standards you could use the Image Acquisition toolbox. Or use a smartphone and ipcam; or use webcam
Any project that you would write to get this parallel-interfaced camera data into MATLAB is doomed (unless you can use a 64 bit VISA driver): you would need to use software that is already obsolete, on an operating system that is not updated for even major security problems. There is no future in it.
See Also
Categories
Find more on Troubleshooting in Image Acquisition Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!