Detect color in composite video

Thread Starter

anyh

Joined Sep 3, 2015
6
I have a composite video signal that is mostly black and white. Once in a while there will appear colors in the video (yellow in this case). I would need to detect when this color appears on screen. Is there a simple circuit to build or some ready made circuit that can detect colors in video signal.

When the color is detected I would like to generate a audio signal. But that part should be easy once the color is detected.

Thanks,
Andreas
 

blocco a spirale

Joined Jun 18, 2008
1,546
I don't think there is a simple way to do this as a composite video signal is quite complex. If you convert the composite video to RGB, using an inexpensive off-the-shelf converter, it may be possible to measure the red and green (yellow) signal levels relative to the blue and provide an output above a certain threshold. I expect that for a monochrome output the signal levels will be nearly identical.
 
Last edited:

Thread Starter

anyh

Joined Sep 3, 2015
6
Thanks for your suggestion. Do you think this also work if only a small portion of the image is yellow. Forgot to mention that the yellow part is only about 1-2% of the image.
 

dl324

Joined Mar 30, 2015
16,910
This is what the NTSC composite video signal looks like:
ntscCompVideo.jpg

Colors are represented by voltage levels so you may be able do it with a simple window detector.

I don't have info on PAL composite video format...
 

dl324

Joined Mar 30, 2015
16,910
It's going to be a bit more involved than a level detector. Color information needs to be separated from brightness...
 

nsaspook

Joined Aug 27, 2009
13,262
20030830-003.jpg What you would have to build is a simple digital Chroma key that locks into the colorburst and looks at the level of energy at the Yellow phase angle of the chroma signal. You could build most of it from a NTSC/PAL decoder chip (that has pins for the signals) for the ref and sub-carrier signals with a custom phase detector to generate a signal when the color you want is present. Not a trivial task but easily possible today with a few chips. I built a NTSC sync generator/ decoder for an old TV station video camera once but it's long in the dump somewhere.


That's what they do with weatherman and green/blue suit overlay.
https://en.wikipedia.org/wiki/Chroma_key
In analog color TV, color is represented by the phase of the chroma subcarrier relative to a reference oscillator. Chroma key is achieved by comparing the phase of the video to the phase corresponding to the preselected color. In-phase portions of the video are replaced by the alternate background video.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
11,037
Colors are represented by voltage levels so you may be able do it with a simple window detector.
Sorry, dl. I usually admire your posts, but this time you missed big time. Color in NTSC (National Television Standards Committee (never twice same color)) video is a 3.58 MHz subcarrier that is both amplitude and phase modulated. Its amplitude represents color saturation and its phase represents hue. The result is a double sideband suppressed carrier AC waveform with no DC component. This is summed with the monochrome (contrast), black pedestal (brightness), and sync signals to form what we call composit video. Within some convoluted limits, any color can be any amplitude.

To pick off a particular color, you phase lock to the color burst to generate a continuous phase reference for a demodulator, demodulate the subcarrier to extract a voltage that represents a small range of phase angles around the color of interest, and then amplitude detect this for saturation. This is the signal you can compare against a level for detection. This is the basis of what used to be called a chroma keyer, one of the more complex signal systems in video engineering.

The image you posted is a non-standard test pattern that is a combination of full field bars and a reversed staircase. Staircase is ascending in monochrome amplitude in identical steps from left to right with 40 IRE subcarrier on each step. The phase angle is 0 degrees with respect to burst. Bars have a different color saturation (subcarrier amplitude) for each color. Attached is a sketch I found. Note that yellow and cyan have the same positive peak amplitude (100 ire) and red and blue have the same negative peak amplitude (-40 ire). These are limits set to keep the positive chroma peaks from driving older transmitters to cutoff, and to keep the negative chroma peaks from confusing older sync separators in 1950's vacuum tube TVs.

akFullFieldBars-SS06060047im-c.jpg
 
Last edited:

Thread Starter

anyh

Joined Sep 3, 2015
6
View attachment 90971 What you would have to build is a simple digital Chroma key that locks into the colorburst and looks at the level of energy at the Yellow phase angle of the chroma signal. You could build most of it from a NTSC/PAL decoder chip (that has pins for the signals) for the ref and sub-carrier signals with a custom phase detector to generate a signal when the color you want is present. Not a trivial task but easily possible today with a few chips. I built a NTSC sync generator/ decoder for an old TV station video camera once but it's long in the dump somewhere.
This seems like a possible solutions. Not really sure how to do this, but found a couple of chips that might be used as a start?

TDA3562A http://www.datasheetarchive.com/dl/Datasheet-021/DSA00377438.pdf

http://www.maximintegrated.com/en/products/analog/video-products/MAX9526.html/tb_tab0 (might be overkill for this)

This would be easy via software also, but that need quite a lot of extra hardware.
 

nsaspook

Joined Aug 27, 2009
13,262
This seems like a possible solutions. Not really sure how to do this, but found a couple of chips that might be used as a start?

TDA3562A http://www.datasheetarchive.com/dl/Datasheet-021/DSA00377438.pdf

http://www.maximintegrated.com/en/products/analog/video-products/MAX9526.html/tb_tab0 (might be overkill for this)

This would be easy via software also, but that need quite a lot of extra hardware.
Those chips don't provide the needed signals. You need a building block chipset that's maybe hard to find now with the level of integration on decoders.

I'm sure most high-end video suites have chroma key or a Chroma Vectorscope that can be used to trigger an event from the input from a capture card.
http://lacquersoftware.com/pixelconduit.html
Keying
Blue / green screen keying is a fundamental compositing task, and Conduit makes it easier to pull the best possible key every time. With the power and flexibility of node-based compositing, you can start with the advanced built-in keying tools such as Color Difference, Color Range, 3D Key, Unspill & Despill and then finetune the matte with other tools, or you can even build your own keying method from scratch — all without the realtime renderer missing a beat.

Scopes
Vectorscopes very useful for monitoring the video signal. You can't always trust your eyes, but the graphic doesn't lie... They're particularly useful for greenscreen effect shoots and other situations where you need to ensure that color levels are within a certain range and don't have too much variation.

Scopes are available in all Conduit plugins as well as the PixelConduit application. The available types include Luma, Y'CbCr Parade, RGB Parade and Chroma Vectorscope.
 

dl324

Joined Mar 30, 2015
16,910
Sorry, dl. I usually admire your posts, but this time you missed big time.
I guess I should be flattered, but I haven't done anything to deserve anything even remotely resembling admiration from anyone.

Truth be told, my knowledge in this area is weak at best. As I recall, we were given an option from my EE instructors circa 1975 to study for the FCC exams; so my knowledge is about as good as some high school student cramming for the SATs. We spent a term studying communications, went to Portland and took the 3rd, 2nd, and 1st class FCC license tests in one sitting. I didn't pass the 1st class test and I never worked in that field; so I've forgotten most of it... My only regrets are that I didn't use that knowledge enough to retain it; and that I let my license expire (I got it before the FCC started issuing lifetime licenses).:(
 

nsaspook

Joined Aug 27, 2009
13,262
I guess I should be flattered, but I haven't done anything to deserve anything even remotely resembling admiration from anyone.

Truth be told, my knowledge in this area is weak at best. As I recall, we were given an option from my EE instructors circa 1975 to study for the FCC exams; so my knowledge is about as good as some high school student cramming for the SATs. We spent a term studying communications, went to Portland and took the 3rd, 2nd, and 1st class FCC license tests in one sitting. I didn't pass the 1st class test and I never worked in that field; so I've forgotten most of it... My only regrets are that I didn't use that knowledge enough to retain it; and that I let my license expire (I got it before the FCC started issuing lifetime licenses).:(
I had my FCC 1st class at about the same time frame and did a little work with Military CCTV studio equipment (propaganda) but most of it involved RF stuff.
 

bertus

Joined Apr 5, 2008
22,276
Hello,

The TDA chip can be used, using the PAL/NTSC circuit in the datasheet.
Also the TDA3266 could be used.

Bertus

PS in europe we make jokes about NTSC and say Never The Same Color.
 
Last edited:

Thread Starter

anyh

Joined Sep 3, 2015
6
Those chips don't provide the needed signals. You need a building block chipset that's maybe hard to find now with the level of integration on decoders.
Do you have any examples where to start search with the chipset?

I'm sure most high-end video suites have chroma key or a Chroma Vectorscope that can be used to trigger an event from the input from a capture card.
http://lacquersoftware.com/pixelconduit.html
Yeah, it's also quite easy to find the yellow color via any software library (if you know programming). But would prefer a small hardware only solution here if possible.
 

nsaspook

Joined Aug 27, 2009
13,262
Hello,

The TDA chip you referred to is for PAL.
for NTSC you will need a different circuit.

Bertus

PS in europe we make jokes about NTSC and say Never The Same Color.
SECAM while French was another system better than NTSC but they are all becoming obsolete with digital.
 

crutschow

Joined Mar 14, 2008
34,410
..................
PS in europe we make jokes about NTSC and say Never The Same Color.
I heard it as "Never Twice the Same Color." ;)
That was rather true in the early years, but later on the better TV sets compensated for the color shifts (due to phase shift of the color carrier in transmission) and it generally was not a significant issue.

PAL minimized that problem by alternating the color carrier phase by 180° each line to average out any phase error.
SECAM while French was another system better than NTSC but they are all becoming obsolete with digital.
Here, SECAM was referred to as "Something Exceedingly Contrary to the American System" given France's general apparent disdain (at least at that time) for anything American (or NIH) since the PAL system was essentially the American system with one modification (to the color carrier phase).
 
Top