Shop OBEX P1 Docs P2 Docs Learn Events
Propeller and OpenCV — Parallax Forums

Propeller and OpenCV

Jeff_BirtJeff_Birt Posts: 25
edited 2009-07-01 20:57 in Propeller 1
I saw an add in Circuit Cellar about the Propeller and OpenCV. I got excited and have been tyring to find out what sort of OpenCV support there really is. I 'thought' that maybe there was an OpenCV port for the Propeller but it looks like the OpenCV is limited to the ViewPort application.

So color me confused. What is this OpenCV support for? If I could use OpenCV on the Propeller I would be super excited. It would be great to move my current OpenCV app from the PC to the Propeller.

Comments

  • HannoHanno Posts: 1,130
    edited 2009-05-04 18:08
    Hi Jeff,
    I'm the author of ViewPort and a big proponent for building cool things with the Propeller.

    OpenCV is a full-featured computer vision package, initially started by Intel and now, a decade later, maintained by Willow Garage- which is funded by a Google billionare. Stanford won the last Darpa challenge using OpenCV to do their vision processing. As you probably know, sophisticated vision processing takes quite a bit of memory and processing power. In the March edition of Circuit Cellar I published an article explaining how to do simple vision processing purely on the Propeller.
    The OpenCV plugin (which you can try for free in the 30-day trial of ViewPort: mydancebot.com) makes it easy for people to get started with computer vision. You don't have to compile anything, you don't need any libraries- you just need the 3MB ViewPort download and a USB camera. One of the samples that comes with ViewPort tells you more about OpenCV, and also shows how to integrate OpenCV with programs running on the Propeller. The sample program uses 1 line of spin to configure OpenCV to find human faces. The x,y location of that face is sent through ViewPort to a Propeller program where you could do all sorts of things- move servos, control robot motors, etc.

    A simple but compelling demo is to mount a doll's head to a hobby servo and have it track you. A couple months back I posted something similar- to guide a camera to videotape a wedding: use the white blob finder to track the bride, black blob to find the groom, and highly colored to find the mother of the bride!
    Feel free to ask more.... Last Friday I demoed ViewPort with great success to the people at Willow Garage, next week I'll do a Google Talk which should be available on YouTube afterwards.
    Enjoy!
    Hanno
  • Jeff_BirtJeff_Birt Posts: 25
    edited 2009-05-28 21:22
    So the OpenCV support in ViewPort is an easy way to integrate the Propeller with OpenCV and a USB cam (the latter two on your PC). I guess this is what my understanding is but I just have not seen that explicitly explained anywhere.

    Thanks!
  • HannoHanno Posts: 1,130
    edited 2009-05-28 22:03
    Hi Jeff,
    Yes, your understanding is correct: ViewPort makes it easy to integrate the Propeller with OpenCV. The input video for OpenCV can be either a Webcam- or other device that OpenCV supports, a video file/picture, or grayscale video grabbed on the Propeller. This should open all sorts of computer vision applications for Propeller based systems.
    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!
  • Shane MShane M Posts: 58
    edited 2009-06-30 02:54
    Sounds good. But DO YOU NEED a PC to get the vidoe? Or can you hook the usb camera up directly to the propeller? That is the confusing part for me. Can you clear that up? The example 15 looks like it needs the PC with the camera.

    Thanks in advance.

    Shane
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-30 03:37
    The OpenCV processing is done on the PC. The video is sent directly to the PC from a webcam for this processing or a grayscale still image can be "grabbed" on the Propeller with some kind of image sensor (not part of ViewPort) and transferred to the PC. The Propeller handles the output of the OpenCV processing.

    You cannot hook up a USB camera directly to the Propeller. You can hook up some lower resolution image sensors to a Propeller and do basic image processing on the smaller images as Hanno has described. The Propeller just doesn't have the memory and speed to handle full resolution video.

    Post Edited (Mike Green) : 6/30/2009 3:43:04 AM GMT
  • HannoHanno Posts: 1,130
    edited 2009-06-30 04:54
    Mike is correct- as always [noparse]:)[/noparse]
    ViewPort supports two ways of working with video.

    Option 1: NTSC Signal->ADC->Propeller
    This does NOT require a PC. The frame grabbing and filtering is done on the Propeller. Due to the limited processing power and memory, only 200x240x16 shades are grabbed and filtered in real time. However, this let's you control robots with vision!

    Option 2: Webcam->PC with ViewPort->Propeller
    This requires a PC, but provides you with state-of-the-art vision functions, like finding human faces. The object's location and size is continually sent to the Propeller, where your spin code can do cool things with it.
    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!
  • mctriviamctrivia Posts: 3,772
    edited 2009-06-30 08:29
    so what kind of things can be done with option 1? can i track direction and distance of the white bride to take lots of pics?

    it would be cool to set up a bride stocking robot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • HannoHanno Posts: 1,130
    edited 2009-06-30 20:41
    Hi,
    I use option 1 for my fully autonomous DanceBot. There's a video on my site mydancebot.com/viewport/videos where I show how I use the camera to do line following from a distance. I also use PropCV to sense where a person is, by first grabbing a new frame, then filtering the image to look for vertical edges, then looking for multiple strong edges close together, then finding the maximum of that- in effect getting me a bar-code finder. I use the position of the barcode to control the rotation and position of my dancebot. This makes it dance with people. See also the Circuit Cellar article I wrote in March, there's a link on my site.
    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!
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-07-01 01:03
    Is this feature availible on the Standard or Ultimate viewport?
    If on the standard I might buy it and have some interesting projets comeing up soon.....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.



    If it's not Parallax then don't even bother. :-)
    ·

    Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
    Cheap·shipping unless specified!· ···· Order 100 get 25 FREE!····· About 300 left!!··


  • HannoHanno Posts: 1,130
    edited 2009-07-01 01:19
    Option 1 is included in Standard ViewPort. For $59 you get all sorts of instruments to analyze your data, the fuzzy logic engine, the PropCV vision engine including frame grabber and video filters (you need to supply the hardware), and of course the spin debugger. For $149, you get the development kit and designer that let's you customize ViewPort's interface, the OpenCV integration, and high speed mode. Try out the free download in my signature for 30 days- plenty of happy customers so far! You can also upgrade your license key later at: http://mydancebot.com/viewport/upgrade.php
    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!
  • mctriviamctrivia Posts: 3,772
    edited 2009-07-01 01:57
    one feature you are missing is an eeprom analyser. would be nice to see what is happening in the top 32k of eeprom right from your program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-07-01 10:11
    ViewPort is $29 from your website, not $59 like on the Parallax website. ???
    Is the version on your website the standard or Ultimate?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.



    If it's not Parallax then don't even bother. :-)
    ·

    Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
    Cheap·shipping unless specified!· ···· Order 100 get 25 FREE!····· About 300 left!!··


  • HannoHanno Posts: 1,130
    edited 2009-07-01 10:44
    These are the options from my website storefront (mydancebot.com/viewport/register.php)
    $29 - Lite (Low-speed transfer, small data buffer)
    $59 - Standard (Low-speed, spin debugger)
    $89 - High Speed (High-speed, spin debugger)
    $149 - Ultimate (Includes High-speed, Debugger, OpenCV, development kit and designer)

    The Standard and Ultimate versions are being distributed by Parallax for the same price as on my website.
    The $29 version you're referring to doesn't have the spin debugger.

    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!
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-07-01 11:01
    What IS a debugger? This is one of those terms that are so common no one ever tells the definition of it. Is a debugger something I need? Is it truly worth the extra money? My projects don't ever need an ocilliscope so do they need a debugger?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.



    If it's not Parallax then don't even bother. :-)
    ·

    Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
    Cheap·shipping unless specified!· ···· Order 100 get 25 FREE!····· 200 left!!··


  • HannoHanno Posts: 1,130
    edited 2009-07-01 11:15
    The ViewPort debugger let's you run your spin code on the Propeller and then pause it at a "breakpoint", or by clicking the "pause" button. Then, you can view variable values, change them, look at global memory, see how much time was spent in different functions, see which functions were called before you got to the current point, and more.

    ViewPort comes with a 30 day free trial, included is a manual, ~18 tutorials, a link to Andy's excellent PE Lab, and a link to lots of videos on my site. You can also upgrade your license at any point, in any combination- all on my site. mydancebot.com

    In short, the debugger is a tool that makes it easier for you to write more sophisticated programs.
    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!
  • mctriviamctrivia Posts: 3,772
    edited 2009-07-01 16:01
    I downloaded your free trial to see if it would show eeprom values. Dangle basic gave me what I wanted but I like your app. If you could add feature to do eepron dump I would buy in aug when I have money

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us and propmod_1x1 are in stock. Only $30. PCB available for $5

    Want to make projects and have Gadget Gangster sell them for you? propmod-us_ps_sd and propmod-1x1 are now available for use in your Gadget Gangster Projects.

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • WNedWNed Posts: 157
    edited 2009-07-01 17:17
    Hi Hanno,
    I've installed the trial version of ViewPort, and am generally pleased with the tool. One thing I don't quite understand, though, is the need to "pre-load" one's program using the Prop Tool before running it in ViewPort. You've taken ViewPort so far, why not make it a completely independent development environment.
    Back to the topic at hand...
    Hanno said...
    For $59 you get all sorts of instruments to analyze your data, ... the PropCV vision engine including frame grabber and video filters

    ... then...
    Hanno said...
    For $149, you get ..., the OpenCV integration

    Rather than trying to make an "educated" guess I'll just ask, what is the difference?

    Ned

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "They may have computers, and other weapons of mass destruction." - Janet Reno
  • HannoHanno Posts: 1,130
    edited 2009-07-01 20:57
    You don't need to use the Propeller Tool- although for longer editing sessions I still use it because my editing control isn't as full featured yet (will change soon)
    Compiling and loading files from ViewPort to the Propeller has been supported for a long time. Just select a file on the welcome view (you can browse to your own directory if you like or choose from one of the tutorials) and then click the "run" button. This will compile and load the file. If you want to edit your code, just click the "code" view to get a syntax highlighting editor that looks and feels almost like the Propeller Tool.


    The Ultimate package includes the High speed option, OpenCV, Designer, and development kit. OpenCV let's you use the state-of-the-art vision engine that was used by Stanford to win the DARPA challenge with your spin program- for example, to track faces- your spin program gets the x,y position of the found face.
    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!
Sign In or Register to comment.