Page 1 of 1
interlacing: this is the question!
Posted: Tue Jul 31, 2007 9:33 am
by alcool
hi,
i have a simple (I believed...) question: i want to record a car in movement on the street (at least 50 Km/h)... but the image is always afflicted by a blurring and there are more annoying black line (probably the result of a interlacing)... I have read on some post that is possible setting the options "ZM_CAPTURES_PER_FRAME" for reducind this effect... but I do not succeed to do good it! which type of setting I can to do?
Posted: Tue Jul 31, 2007 3:43 pm
by Lee Sharp
The only way to remove interlacing is to capture at a resolution without it. Are you using 320 x 240? As to the blur, that is the cam. What hardware are you using to capture?
Posted: Thu Aug 02, 2007 7:14 am
by alcool
Lee Sharp wrote:The only way to remove interlacing is to capture at a resolution without it.
...how I can do?
Lee Sharp wrote:Are you using 320 x 240?
...I would like use the more hi resolution (640x480 or 704x576)
help...
...how I can do?
Posted: Thu Aug 02, 2007 7:37 am
by cordel
The only way to remove interlacing in a cctv system is to capture at or below 320x240. The other option might be if you can find a progresive scan capture card and camera, if they exist, I'm sure they are pricey.
Your other option would be to use an IP camera possibly.
Other than that there are no other options, it's the nature of how cctv works.
Posted: Tue Aug 07, 2007 9:33 pm
by mebourne
Ideally ZM would include deinterlacing filters which would help a lot. Unfortunately this is probably quite a bit of work. I've thought about it a couple of times but not looked into it yet.
Posted: Wed Aug 08, 2007 9:03 pm
by Lee Sharp
Consider how it would work at worst case, an IP cam.
1) Capture 2 jpegs.
2) Decode 2 jpegs.
3) Merge 2 bitmaps.
4) Analyse merged bitmap, and hope artifact isn't seen as motion.
5) Encode jepg.
6) Save jpeg.
Now do it 30 times a second. Oh, and times 8 cameras.
Posted: Thu Aug 09, 2007 7:09 am
by mebourne
Deinterlacing is on playback of course, not capture.
So for 8 cameras you need to do:
1) Capture image from camera
2) That's it
This happens already, so I don't think there'll be any problem here.
The only capture modification I'd make would be to capture odd/even fields as separate jpegs to prevent interference between them with the lossy compression.
record vs. playback
Posted: Thu Aug 09, 2007 12:35 pm
by darkpaw
There's a potential problem doing it that way. If your capture rate isn't high enough, you will have only one half of the interlace and it can't be merged with the other half.
I have had lots of captures with motion too fast to be grabbed in sequential frames (at 640x480). So if I look at a JPG that has the "lined" part that is in motion, and then the next JPG captured immediately after it, they are not part of the same fps, they are in next frames, and the object has already moved from that position.
On one camera this would be easy, just crank the capture rate up to 30fps and then there's a good chance that you could deinterlace the frames immediately following each other. But on a 1.6 GHz machine with 3 cameras on it, I can't capture any higher than about 12fps or I start getting dropped frames because my CPU isn't fast enough to keep up when analyzing with zma.
Posted: Thu Aug 09, 2007 1:13 pm
by mebourne
Sure, if you don't capture at full frame rate deinterlacing isn't particularly useful. My cameras capture at 10fps until motion is detected, then full frame rate. Given that not all cameras trigger together you can probably get quite a few cameras on any modern box before there's any trouble. Besides, computers get faster all the time so what's possible with current hardware now will be easy with future hardware.
Posted: Fri Aug 10, 2007 1:22 am
by Lee Sharp
mebourne wrote:Besides, computers get faster all the time so what's possible with current hardware now will be easy with future hardware.
And this is how we got Vista!
Fight Bloat! Code on a 386!
Posted: Sat Aug 11, 2007 2:22 pm
by KeithB
Surely IP cameras dont have deinterlace problems. Some are even HDTV so obviously progressive. To encode it as PAL/NTSC then decode it in the very next circuit, in the same box, for no reason would be seriously sloppy design.
Posted: Thu Dec 06, 2007 2:11 am
by jameswilson
just to resurect this, do any of us have any suggestions for using bttv and above half vertical res?
The only reason i ask is cos my own setup at home has a nice camera on it and id like to run at 720x576.
James
Posted: Thu Dec 06, 2007 7:49 am
by kevin_robson
I've no answers as such.
But I've recently started using mythtv, which has build in support for deinterlacing. Waching the football the other night it seems quite effective.
I dont know any more than that, but perhaps there is someone out there technical enough to work out how it does it and apply it to ZM?
Just a thought.
Posted: Thu Dec 06, 2007 6:08 pm
by Lee Sharp
This keeps coming up... Of course my partner keeps asking the same thing, and he still doesn't get it either.
So first, start here.
http://www.jkor.com/peter/tvlines.html That should give you a nice headache.
But the point is this... The composite video standard
requires alternating black lines. To give a clear picture the odd lines are black in one frame, and the even lines are black in the other. Now black in analog video is simply the absence of light... That means any color overwrites it. So if I combine line 1 and 2, the black is completely covered by the image. This is why 320 x 240 looks clean.
Now deinterlacing is a hack... On old analog TVs it was moot as the image from the last frame is still slightly glowing when you paint the next frame. This does not work in digital, so they had to develope a few hacks. Mostly it is done with frame averaging. This means every frame is the current frame, and the frame immediately prior layered on top. Another method is frame stretching. a frame is captured at 640 x 240, and all horizontal lines are doubled, so you get a 640 x 480 pic. Both hacks have issues. In the first one, you have the most data, but a different times. This can give a comb look to fast moving images. There is a decomb filter just to address this on DVDs. The other method can look better with fast moving images, but it has less data, while taking up just as much space and bandwidth.
A possible solution... I had a thought.... What if we could capture at 640 x 240, and store at 640 x 240, but display and export at 640 x 480? Lots of advantages here is space, quality, processing time to analyze and store, and best of all, it would be someone else doing it!
In case you didn't know, my coding skills stink...
Posted: Thu Dec 06, 2007 11:00 pm
by jameswilson
I use interpolation to achieve this live an playback in zm4ms, but d1 is better.
De-interlacing is possible and there are various ways to do it. and i do understand the issues but even 2 cif has res issues.