Why am I getting horizontal scanline distortions in the images acquired using Image Acquisition Toolbox 4.2 (R2011b)?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 13 Mar 2012
Edited: MathWorks Support Team
on 26 Oct 2013
I am using a frame grabber with the winvideo adaptor to acquire images using the Image Acquisition Toolbox 4.2 (R2011b). However, the frames acquired by MATLAB comes out distorted, with horizontal scanline like artifacts in the image. It also comes out distorted using AMCAP. See the top image below:
However, if I use the manufacturer's driver software, I get the clean image as shown below:
How can I fix this in MATLAB?
Accepted Answer
MathWorks Support Team
on 18 Oct 2013
When using an analog camera with frame grabber, this may be an issue with the PAL versus NTSC format.
The PAL format is an old poor quality format and is the one most likely giving the distortions. Switching to the NTSC format, as outlined below, should fix such distortions. The manufacturer's driver was most likely defaulting to the NTSC format, thus displaying the clear frame.
You should be able to set the better format by code similar to below:
%obtain video input object (the frame grabber)
vid= videoinput('winvideo', 1);
%obtain video source object (the camera)
src= getselectedsource(vid);
%check the format of the source, which should return PAL
get(src, 'AnalogVideoFormat')
%set the format of the source to NTSC
set(src, 'AnalogVideoFormat', 'ntsc_m');
Please note that different cameras and devices use slightly different naming conventions for the formats. Such as, in this case, the NTSC format is referred to as 'ntsc_m' and the PAL format is referred to as 'pal_b'. Please run IMAQSUPPORT with the devices connected, and the output text file should list possible options under 'AnalogVideoFormat' field of the specific device.
0 Comments
More Answers (0)
See Also
Categories
Find more on National Instruments Frame Grabbers 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!