Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible to sample luminance of black and white PAL video signal using pr — Parallax Forums

Is it possible to sample luminance of black and white PAL video signal using pr

PopMiloPopMilo Posts: 5
edited 2009-06-30 05:52 in Propeller 1
Is it possible to sample luminance of black and white PAL video signal using propeller ?

Here is what I would like to do:
1. wait for VSync...
2.To wait for HSync...
To sample N luminances (system clock would be adjusted to some fixed ratio of pixel rate frequncy) and put them into COG ram - or Ram ?
repeat 2.

If N is large, information wouldn't fit into one cogs ram...
Is it possible to transfer one line info into RAM while incoming video signal is outside the interesting part of picture ?
Or is it better to use two cogs alternating on each line ?
What is bigest precision that can be achieved ?

Is it maybe possible to extract chroma information or is it to much to ask ? [noparse]:)[/noparse]

Comments

  • kwinnkwinn Posts: 8,697
    edited 2009-06-28 17:22
    It is possible to do it at low resolution with the prop and an adc. The prop has 4K longs or 32K bytes of hub ram to store the image, which would limit the resolution. A maximum of 320 x 200 x 4 shades (2 bits) of grey would be possible. With external adc, ram, external address counter, and some very tight PASM coding it might be possible to acquire a full resolution image with 256 shades (8 bits).
  • PopMiloPopMilo Posts: 5
    edited 2009-06-28 21:09
    Could I do it without ADC if I would need only to distinguish black or white levels ?

    Could I interpret one line as a serial data stream ?
    Would use of counters help ?

    And how would I do it exactly ? [noparse]:)[/noparse]

    What if luminance value would be a stream that looked like this "1xxx..........xxx0" ?
    Could that be interpreted as serial data with start and stop bit ?

    Maybe it would help if I would tell what am I thinking to use it for [noparse]:)[/noparse]

    How much information could be outputted through video output of old computers that use PAL/NTSC tv signal and how much of that could be captured by propeller ?

    Average 8bit computer showed 320x200 picture. That is 8000 bytes.. Even more if shades could be used...
    That means that with changing screen data pointers in few frames some of them could output almost whole memory through one wire !

    Have no idea why would it be useful [noparse]:)[/noparse]
    but it sounds interesting enough [noparse]:)[/noparse]

    What if one cog would capture one scan line of data (extracted from luminance),
    in the next line second cog starts capturing next scan line,
    while the first cog starts outputing new tv (or VGA) signal constructed from captured data, but with different characteristics (resolution, colors...)

    Or capture number of lines.. (320 pixels would be 40 bytes... there is enough cog ram for more than couple of lines..)

    Maybe capture whole frame and display it on vga while second frame is being grabed....
    Flicker fixer (convert pal to vga ?)

    Or interpret that data in some other way ...
  • RaymanRayman Posts: 14,841
    edited 2009-06-28 22:39
    Try searching the forum for "Stupid video capture", I think that's similar to what you want...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-06-29 00:19
    Just my suggestions here with performing a video capture. You could feed the video signal into a comparator and an RC DAC into the other input to set the threshold. Assuming your video signal is stable over several frames which sounds like it might be then you can read a frame at a certain threshold level and on the next frame read at a different level etc to increase the grey levels. Also using the stable frame technique you can also offset your sample time each frame to incrementally increase the resolution. It is not necessary to be limited by the amount of internal RAM as you can use an external RAM scheme such as Cluso's RamBlade.

    You cannot feed the video signal directly into the Prop without some sort of comparator or buffer as the level will be too low for the Prop to detect as a "high".

    *Peter*
  • PopMiloPopMilo Posts: 5
    edited 2009-06-29 07:36
    I would use external circuit to get proper input voltage levels for propeller...
    I found "stupid video capture".
    http://forums.parallax.com/forums/default.aspx?f=25&m=227676

    Looks great, seams to work, just what I wanted [noparse]:)[/noparse]
    It does 5bit sampling at 2.5 MHz.
    It means its quite easy to do 2bit sampling at 10MHz...
    And I need only 1 bit at 8MHz... [noparse]:)[/noparse]
    Thanks...
  • RaymanRayman Posts: 14,841
    edited 2009-06-29 10:48
    I'm not sure 5-bit works... I've used it at 6-bit. I think I remember that's how it's set up...

    PS: Take a look at "Stupider Video Capture" to see what I did with my PSM [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • PopMiloPopMilo Posts: 5
    edited 2009-06-29 13:52
    It should [noparse]:)[/noparse]

    I also found this: http://www.brouhaha.com/~sdenson/Propalyzer/

    it claims 80Mhz... tha should be more than enough [noparse]:)[/noparse]

    Im ordering my new demo board and then I can try it.....
  • HannoHanno Posts: 1,130
    edited 2009-06-30 00:34
    Check out the "PropCV" object that comes with ViewPort. It uses an external adc to grab NTSC signals into main memory at 200x240x16levels of gray. It then runs vision algorithms to find things like brightest dot, edges... The result can be used to control robots- I use it to make my dancebot dance with people wearing a barcode pattern. The raw and filtered video is streamed to ViewPort at ~10fps so you can see what's going on.
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • PopMiloPopMilo Posts: 5
    edited 2009-06-30 05:52
    Didn't know that, thanks!
Sign In or Register to comment.