Detect color in composite video

Discussion in 'General Electronics Chat' started by anyh, Sep 3, 2015.

  1. anyh

    Thread Starter New Member

    Sep 3, 2015
    6
    0
    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
     
  2. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    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: Sep 3, 2015
  3. anyh

    Thread Starter New Member

    Sep 3, 2015
    6
    0
    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.
     
  4. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    I'm sure that it must be detectable but I don't know how difficult this would be to implement reliably.
     
  5. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    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...
     
  6. BR-549

    Well-Known Member

    Sep 22, 2013
    1,982
    388
    Is there a magnetic field close to your display?
     
  7. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    It's going to be a bit more involved than a level detector. Color information needs to be separated from brightness...
     
  8. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,907
    2,168
    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
     
    Last edited: Sep 3, 2015
  9. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,534
    1,251
    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.

    ak FullFieldBars-SS06060047im-c.jpg
     
    Last edited: Sep 4, 2015
    Robin Mitchell likes this.
  10. anyh

    Thread Starter New Member

    Sep 3, 2015
    6
    0
    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.
     
  11. bertus

    Administrator

    Apr 5, 2008
    15,647
    2,346
  12. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,907
    2,168
    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
     
  13. dl324

    Distinguished Member

    Mar 30, 2015
    3,242
    619
    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).:(
     
  14. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,907
    2,168
    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.
     
  15. anyh

    Thread Starter New Member

    Sep 3, 2015
    6
    0
  16. bertus

    Administrator

    Apr 5, 2008
    15,647
    2,346
    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: Sep 3, 2015
  17. anyh

    Thread Starter New Member

    Sep 3, 2015
    6
    0
    Do you have any examples where to start search with the chipset?

    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.
     
  18. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,907
    2,168
    SECAM while French was another system better than NTSC but they are all becoming obsolete with digital.
     
  19. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,907
    2,168
  20. crutschow

    Expert

    Mar 14, 2008
    13,003
    3,232
    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.
    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).
     
Loading...