Closed Thread
Page 1 of 6 123 ... LastLast
Results 1 to 10 of 56

Thread: Webcam (E2)

  1. #1
    Wirererer Josef's Avatar
    Join Date
    Dec 2007
    Posts
    159

    Default Webcam (E2)

    Edit: Updated the attachments to support the new variable-resolution digital screens, but this example is still 32x32. Also increased the rendering to match the scanning rate (runs even smoother now ). New video too.


    This is basically a 32x32 pixel digital camera that has been sped up substantially. The small expression runs nearly 3000 times per second to display live moving greyscale images at over 10 FPS. Here's a video that demonstrates its speed:


    How is it running so fast? A single Random chip feeds four inputs of an expression ("cascader") whose sole operation is flipping a persistent variable between 0 and 1 (Out = !Out). Since the Random chip generates a consistent stream of 67 random numbers per second and expressions execute once for any change in input, this chip becomes an On/Off flip-flop that runs at 67x4=268 Hz. Incidentally, 268 Hz is also the maximum speed that both E1 and E2 expressions can be triggered by change in a single input; any faster and they will begin to skip execution.

    The output of the first expression feeds 11 inputs of the main camera expression ("eye") to multiply the running speed to 2948 Hz. Four ranger readings per run give a speed of 11,792 pixels/second (by comparison, the external Ranger supplies data at only 22 pixels/second). Since a 32x32 screen is 1024 pixels, this means a whole picture can be captured and displayed every 0.087 seconds (11.5 FPS).

    A mechanism I implemented to avoid lag was to skip re-rendering the parts of the image that had stayed the same and only update that which had actually changed. To do that I saved each calculated pixel brightness to an array, and only updated the pixel on the screen if the value no longer matches the previous stored one.

    Feel free to tune my design to your own liking. If you don't plan on using a video screen (i.e. you'll be storing pictures first and displaying them later like a regular camera), then adding more inputs and/or more internal ranger readings per execution would increase the data collection rate to even more stupendous heights. You might be able to take a true 1 megapixel photo in a reasonable amount of time . Just be sure to post a reply in this thread so that I can see what you've built.
    Attached Files Attached Files
    Last edited by Josef; 06-13-2009 at 03:35 PM.

  2. #2
    Wire Sofaking mjmr89's Avatar
    Join Date
    Mar 2008
    Posts
    555

    Default Re: Webcam (E2)

    This------------------------->







    My head -> :S



    In a good way

  3. #3
    Wire Sofaking Officer Tibbles's Avatar
    Join Date
    Aug 2008
    Location
    Barnus Philbert Boulevard
    Posts
    867

    Default Re: Webcam (E2)

    Man, that thing gets better FPS than my old computer.

    Nice work!

    /me forks over a cookie

  4. #4
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    5,993

    Default Re: Webcam (E2)

    Very impressive
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  5. #5
    Wire Sofaking Whodunnit's Avatar
    Join Date
    Jan 2008
    Location
    New Zealand, Ackl
    Posts
    636

    Default Re: Webcam (E2)

    why not set interval? or use a square pulse? why a random gate?
    ЗАГРУЗКА...................

  6. #6
    Wirererer Incompatible's Avatar
    Join Date
    Jul 2007
    Posts
    156

    Default Re: Webcam (E2)

    I will attempt this later with some of the tools in my toybox.

    I got my E2 to execute 172,000 times a second, on multiplayer with 6 people connected, and that was me being liberal. I will do further tests tomorrow on singleplayer to see how high I can crank it up before it goes Kaput.

    I also have a GPU made that works like a digital screen, I still need to do more testing on it, but it should be able to handle much greater painting speeds.

  7. #7
    Wire Sofaking oenmaster's Avatar
    Join Date
    Jan 2008
    Location
    fak where is my satnav (NL)
    Posts
    717
    Blog Entries
    1

    Default Re: Webcam (E2)

    overclock i like it


    PS

    box head....

    all the player model have box heads......... ö

  8. #8
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: Webcam (E2)

    Very nice!
    You could try using writeString per character, it has that functionality built-in (skip redrawing the same chars and colors), and it does both char and color at the same time in Lua. You should probably see decent performance gain if you use that instead.

    Quote Originally Posted by Whodunnit View Post
    why not set interval? or use a square pulse? why a random gate?
    Because random is more reliable, pulses can "merge" if they are too fast and then nothing happens.

  9. #9
    hurrr physics Tolyzor's Avatar
    Join Date
    Aug 2008
    Location
    England
    Posts
    1,001

    Default Re: Webcam (E2)

    Syranide why can't you just officialy allow e2 to run at this speed, instead of forcing people to use workarounds like random inputs?

    btw Josef that thing is frikken awesome.

  10. #10
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: Webcam (E2)

    Quote Originally Posted by Tolyzor View Post
    Syranide why can't you just officialy allow e2 to run at this speed, instead of forcing people to use workarounds like random inputs?

    btw Josef that thing is frikken awesome.
    Because then people would on public servers and everyone come whining here that the E2 is crashing and slowing down servers.
    When you run at that rate you're creating serious performance problems.

    Additionally, people would use it for non-sense stuff anyway, like having interval(0.1) for updating their spaceship, even though it would only make the spaceship perform worse.

Closed Thread
Page 1 of 6 123 ... LastLast

LinkBacks (?)

  1. 06-16-2010, 05:46 AM
  2. 02-27-2010, 04:06 AM
  3. 02-12-2010, 02:02 PM
  4. 02-05-2010, 02:39 PM
  5. 01-31-2010, 07:42 AM
  6. 01-29-2010, 01:26 AM

Similar Threads

  1. Streaming (Webcam) Video to a Wire Screen
    By eth0 in forum Ideas & Suggestions
    Replies: 13
    Last Post: 07-25-2007, 01:33 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots