Shop OBEX P1 Docs P2 Docs Learn Events
Image Processing — Parallax Forums

Image Processing

pbhuterpbhuter Posts: 36
edited 2010-08-10 14:20 in Propeller 1
I need to know if it is possible for the Prop chip to look at an image captured by a B/W camera (I know I can take a picture based on several forum posts), determine the five or so brightest points in the picture (it will be a bunch of light points on a dark background), locate those points on some sort of grid (based on pixel location, maybe?), and figure out the vectors between the points (I'm pretty sure it can do this last part). I need it all running on one cog, if possible, and it has to all work on the Prop chip and board. Thanks.

Comments

  • LeonLeon Posts: 7,620
    edited 2010-08-10 04:08
    How big is the image?
  • pbhuterpbhuter Posts: 36
    edited 2010-08-10 04:13
    Ah Leon, you read my posts again...

    Not sure yet how big it will be. It will be mostly black with several points of light (white). I'm going to have external memory on my board, so I should be able to store the image there to look at it. I'm still trying to work out the capabilities of the Prop chip, and haven't actually started building anything yet. The creator of ViewPort references a camera in his "DanceBot", I would be using something similar to that, probably.
  • LeonLeon Posts: 7,620
    edited 2010-08-10 05:07
    It looks like you can use "sparse array" techniques, so the memory requirements will be minimal. You should be able to use a Propeller for that.
  • pbhuterpbhuter Posts: 36
    edited 2010-08-10 05:10
    Great! Now, to figure out how to do it...

    Thanks Leon.

    Paul
  • TubularTubular Posts: 4,717
    edited 2010-08-10 05:23
    One option is the TTL VGA camera by 4d systems ($59). This has an image buffer on board. The resolution can be set at 80x60, 160x120, 320x240, 640x480, plus a few others in between. The image can be read out (serially) in greyscale (2, 4 or 8 bit) or in color. It should be possible to parse the data as you go, just recording the "hotspot location(s)" for each line, if that is all you're after.
  • pbhuterpbhuter Posts: 36
    edited 2010-08-10 05:34
    I'm looking at the 4D Systems website, and I don't see the camera you're referring to. I see a TTL uCAM (microCAM) that is being developed - is that what you're talking about? This camera could suit my needs... Do you know how I would parse the data coming out of it? I must admit that I don't really know anything about image processing, so this is all a new area for me. I'm guessing that the camera would output on the serial link each pixel line-by-line and I would read that output pixel-by-pixel and note which one(s) showed up as white in a grayscale image. If I note which pixel(s) and which line(s) for each bright spot, I could figure out the vectors between them. Am I doing this correctly, or am I totally off? Thanks.

    Paul
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2010-08-10 08:05
    May I ask what your application is? There may be another solution.

    Graham
  • mwalimumwalimu Posts: 44
    edited 2010-08-10 08:17
    You could use a mouse optical chip such as adns2610(available at mouser or digikey fro less than $1.50). They give you a 324 pixel image, which is a surprisingly decent picture. The only drawback is fitting a lens and finding the algorithms to process the image.
  • RaymanRayman Posts: 14,889
    edited 2010-08-10 08:17
    If you're just looking for points... I've seen the Wiimote hacked for it's I2C camera with built in IR point tracking... Just a thought.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2010-08-10 09:19
    Rayman, that was what I was thinking, you can find my object for it in the obex. You can track 4 blobs at 200hz and if they are LEDs that you control you can track more blobs at lower frame rates.

    Graham
  • pbhuterpbhuter Posts: 36
    edited 2010-08-10 09:36
    Basically it's pattern recognition. I will have a database of points that I will be comparing the points found in the image to.
  • RaymanRayman Posts: 14,889
    edited 2010-08-10 09:47
    In that case check out my camera page:
    http://www.rayslogic.com/propeller/Programming/Cameras/cameras.htm

    This is a serial camera with a "preview" mode that can quickly transfer low resolution images (I think 80x60 or so). The Prop should be able to do real-time work on that in assembly...
  • HannoHanno Posts: 1,130
    edited 2010-08-10 13:20
    Check out my chapter on Propeller Visions in the "Propeller Guide" book. Also- check out ViewPort and let me know if you need help.
    ViewPort has 2 objects that should interest you:
    - PropCVCapture uses 1 cog to find the H and V-syncs in a NTSC grayscale signal and then captures the video data into memory at several different resolutions- up to 240x200. It packs 8 pixels into each long. This video can be streamed over ViewPort's conduit so you can debug what your camera/image processing algorithm is seeing in real time. At 2mbps you get ~10fps. If you just want to find 1 single bright spot, you can use this object- it'll only take 1 cog and just enough memory for the program- it performs the analysis as the ntsc signal is coming in.
    -PropCVFilter uses 1 cog to run a variety of simple vision filters on data in memory. You can stack filters to create more complicated filters. You can also use up to 4 "vision registers" to do filter math.

    Hanno
  • TubularTubular Posts: 4,717
    edited 2010-08-10 14:16
    pbhuter wrote: »
    I'm looking at the 4D Systems website, and I don't see the camera you're referring to. I see a TTL uCAM (microCAM) that is being developed - is that what you're talking about? This camera could suit my needs... Do you know how I would parse the data coming out of it? I must admit that I don't really know anything about image processing, so this is all a new area for me. I'm guessing that the camera would output on the serial link each pixel line-by-line and I would read that output pixel-by-pixel and note which one(s) showed up as white in a grayscale image. If I note which pixel(s) and which line(s) for each bright spot, I could figure out the vectors between them. Am I doing this correctly, or am I totally off? Thanks.
    Paul

    Yep thats pretty much it. They have a windows utility to set options and watch the serial data going back and forth. The serial data comes out pixel by pixel, or as a jpeg (which isn't as much use here?)
    http://shop.4dsystems.com.au/camera-and-imaging-modules/256-9200.html

    Yesterday I landed a job which needs a dozen of these (or similar), so I'll get getting very familiar with them over the next week or two if you have any other questions.

    edit: Hannos PropCV and the other options look good too, I'm going to play with some of these too. Although my application really just needs a still photo, it would be good to know how easy each of the options are to get running
  • RaymanRayman Posts: 14,889
    edited 2010-08-10 14:20
    I think I got mine at Sparkfun.com, but I see they're out of stock now...
    But, I seem to recall that a couple of other places sold the same or similar things...
Sign In or Register to comment.