View Full Version : Deinterlacing video image

January 14, 2005, 10:57:22
Is it possible to deinterlace video images with IC Imaging Control when displaying ?
I would need so see both fields of one frame, obtaing 50 images / second (PAL system)

Thank you very much for your time and help

Stefan Geissler
January 14, 2005, 13:01:29
Hello Freddy,

It is possible to display both fields of an interlaced image using the IC Imaging Control Active X. But if you use Visual Basic as programming language, then this could not be done in real time. Please see the attached Visual Basic 6 samples. This sample just copies the all even lines to the corresponding odd line. This results in displaying just one field in the full video formats resolution. This is very time consuming, therefore all frames, that are delivered by the IC Imaging Control during the copy function are dropped.

Private Sub ICImagingControl1_ImageAvailable(ByVal BufferIndex As Long)
Dim DisplayBuffer As ImageBuffer
Dim ImageData As Variant

If frametime < ICImagingControl1.ImageBuffers.Item(BufferIndex).S ampleStartTime Then
Set DisplayBuffer = ICImagingControl1.ImageBuffers.Item(BufferIndex)

ImageData = DisplayBuffer.GetImageData
For y = 0 To ICImagingControl1.ImageHeight - 3 Step 2
For x = 0 To 3 * ICImagingControl1.ImageWidth - 1
ImageData(x, y + 1) = (ImageData(x, y) + ImageData(x, y + 2)) / 2
Next x
Next y
DisplayBuffer.ReleaseImageData ImageData
ICImagingControl1.DisplayImageBuffer DisplayBuffer

frametime = ICImagingControl1.ReferenceTimeCurrent - ICImagingControl1.ReferenceTimeStart
End If
End Sub

If you want do display each odd and even field in sequence in real time, you should use C++ and the IC Imaging Control class library. A matching sample is available on request

Stefan Geissler
January 17, 2005, 07:13:35

Over the weekend i had another idea for deinterlaced video display:

Private Sub Form_Load()
ICImagingControl1.Device = "Video to 1394 Converter"
ICImagingControl1.VideoNorm = "PAL_B"
ICImagingControl1.VideoFormat = "UYVY (768x288)"
ICImagingControl1.InputChannel = "00 Video: Composite"
ICImagingControl1.LiveDisplayDefault = False
ICImagingControl1.LiveDisplayHeight = 576


End Sub

This small sample enables the field based video format of the DFG/1394-1. The display height of IC Imaging Control has been set to 576 pixel, that is the standard height of a PAL_B video format. Now the DFG/1394-1 delivers the even and odd fields with 50 fps and they are displayed in the IC Imaging Control's video window with full size, also with 50 fps. Keep in mind, they are only displayed in full size. If you would save the live video images to a file or to an AVI stream, you would only have the half height images of 788 pixel width and 288 height.

You should recognize, that the even and odd fields are displayed starting at the same line in the IC Imaging Control' window. This may results in some vertical flickering, but i was not able to see this, when i tested this sample.