The Computer Vision System Toolbox has an object that can handle three common methods of deinterlacing. The object is intuitively called Deinterlacer
. Let's see its usage on our example interlaced image.
First, we have to load our image. If you have cleared your workspace, type the following command:
>> A = imread('interlaced.bmp'); % Load interlaced image
Then, we have to initialize the
Deinterlacer
object. Let's use the default settings:>> deintObj = vision.Deinterlacer; % create deinterlacing System object
Now it is time to apply the deinterlacing method specified by the default settings (line repetition method) to our interlaced frame:
>> A2 = step(deintObj, A); % Apply de-interlacing method
Finally, we will see the before and after images and cropped parts, side-by-side:
>> B = imcrop(A,[480 400 200 100]); % Crop interlaced detail >> B2 = imcrop(B,[480 400 200 100]); % Crop deinterlaced detail...