PDA

View Full Version : de-interlace



Unregistered
June 19, 2002, 17:25:52
Is there a way to capture a single field (a single image consists of 2 fields) or can I de-interlace a single image with your control?


This message was originally posted by Peter in the old IC Imaging Control Support Forum.

Unregistered
June 20, 2002, 17:10:24
Hello Peter,
the capture device must support this feature. The new version of the driver for our video to 1394 converter (DFG/1394-1) supports field based video formats.

Best regards
Johannes
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

Unregistered
July 2, 2002, 21:55:11
OK Johannes, how do I implement it using the Standard C++ library?


This message was originally posted by JT Fiore in the old IC Imaging Control Support Forum.

Unregistered
July 3, 2002, 08:59:19
Hello,
if the device supports field based image streams, there is nothing to do. Otherwise you copy every odd or even line of an IC image buffer to a new buffer (created by your program).


best regards
Johannes
IC Support


This message was originally posted by IC Support in the old IC Imaging Control Support Forum.

BenignVanilla
October 2, 2003, 20:29:33
Does anyone have an example of such code in VB?

Stefan Geissler
October 6, 2003, 09:54:43
Hello,

The latest DFG/1394-1 (Video to FireWire Converter) driver can deliver the odd or even fields. The video formats have only half height of the normal formats: full 640*480, field format is 640*240.
Using the field based video formats, the image grabbing is the same, as for the full video formats. No special code is necessary to get only every second line.

BenignVanilla
October 6, 2003, 14:53:42
I was hoping to do this in software, using only the control. We have a firewire interface already configured and operating. Now we just want to take still frames from it on an interval.

Stefan Geissler
October 6, 2003, 15:39:49
Hello,

If you want to deinterlace only one frame per software, you should take the even field only. The Visual Basic function for interpolated deinterlacing looks like follows:



Private Sub cmdStart_Click()
Dim ImageData As Variant
Dim x As Integer, y As Integer

ICImagingControl1.LiveStop
'ICImagingControl1.MemorySnapImage
ImageData = ICImagingControl1.MemoryGetImageData
' Take the even fields only
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
ICImagingControl1.MemoryReleaseImageData ImageData
ICImagingControl1.Display
ICImagingControl1.MemorySaveImage "Test.bmp"
End Sub


In this function, the live video is stopped. The last captured frame, that has been automatically snapped to memory, is used for deinterlacing. After deinterlacing, the image is saved to a bmp file.
A complete Visual Basic project is attached to this entry. In this project, the deinterlacing is done during the live video is shown. Most of the frames are dropped, because the deinterlacing takes too much time.