A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Is this possible? getCamera() and circuits

  1. #1
    Junior Member
    Join Date
    Apr 2017

    Is this possible? getCamera() and circuits

    Like old arcade games at bowling alley or whatever, when a player did something in a game, buzzers and light bulbs would flash on/off. I'm not just talking pixels. I am talking circuit open/close, on/off. Is there a plug and play system that ties into flash where I can use actionscript to turn a circuit on/off? I'm asking in the game section because tonypa, squize, tomsamson, yall are brilliant people!

    I extensively studied tonypas tutorials when I was a kid. I also studied engineering physics in community college. I am currently attempting to teach myself vision systems, but I really dislike c++ and java. I LOVE FLASH.

  2. #2
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Whitehorse YT
    You can use the camera and get access to the pixel buffer of captured images but what you're going to miss is extensive collection of fast computer vision algorithms that come with a library like OpenCV. If you're trying to teach yourself about CV then access to the raw pixels is all you really NEED, you can build everything else. You can probably translate whatever algorithms you need from C/C++ to ActionScript but the end result might be significantly slower in ActionScript.

    If you're looking for a way to talk to external hardware then you can check out my product, SWF Studio. I know people have used it to communicate with RFID readers, custom hardware rigs and Arduinos. The magic that makes most of that possible is the SerialIO plugin, it lets you communicate with any device through the serial port. It also has a complete C++ plugin system you can use to write your own plugins to extend Flash.
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  3. #3
    Junior Member
    Join Date
    Apr 2017
    Thank you. The learning can commence. I'm not actually trying to learn all of CV, just a few useful things, like parsing through pixels, summing up # of pixels in a certain color range, etc..
    As far as speed goes, thats not a problem. The psuedo-code for the vision system/sorting machine that I want to make is as follows:

    (object is in nearly same position every time, simple fixture)

    --capture image--
    eliminate/ignore all colors that do not fall into two shades of brown (well, a range of 2 shades of brown)
    if more pixels fall into the first range of brown, turn on dc circuit(1) that powers a solenoid/spring mechanism
    if more pixels fall into the second range of brown, turn on dc circuit(2) that powers a different solenoid/spring mechanism
    --wait about a 1/10 second (just a guess, id play around with this number)--
    turn off all circuits
    --wait about a 1/10 of a second (for spring to return rod to home position)--
    go back to start

  4. #4
    Junior Member
    Join Date
    Apr 2017
    Also, the camera doesn't move, so that makes things easier too.

    On a side note, since your a super moderator you might be able to look into this, but the random security question that asks whats the x number letter in the name of the forum might be confusing people who try to register/do other stuff. It was not intuitive that I was in the board forum at that point.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center