Shop OBEX P1 Docs P2 Docs Learn Events
Image capture and analysis - avoiding wheel reinvention... — Parallax Forums

Image capture and analysis - avoiding wheel reinvention...

slashsplatslashsplat Posts: 63
edited 2013-03-29 18:15 in Propeller 1
I have a project requirement to capture a fairly high res picture of a flat paper up to 6' by 6'. Once captured, the image needs to be compared to the previous image and the difference identified. The "difference" will be a mark ranging from 1/4" to 1/3" in reasonably contrasting color (B&W is fine with some gray scale.)

The camera could be any adequate device, or a webcam with USB to the Propeller.

I have tried the search engine and even Google against this forum and cannot find anything close. Certainly this has been done. If anyone is familiar with any similar projects please direct me there.

Thank you in advance!

Also, if any of you out there are proficient in this area and interested in consulting, please contact me!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
slashsplat
/* Ira Chandler */
BotConnect.com

Comments

  • Bill HenningBill Henning Posts: 6,445
    edited 2009-08-19 06:33
    Let's see what resolution you need:

    6' = 72"

    Nyquest says double the frequency

    Your smallest feature is 1/4", so according to Nyquest we should divide 72" by 1/8" .. you need to resolve at least 390 pixels in each direction.

    I'd feel a lot better with at least twice that resolution in both axes, so I'd look for a 1280x1024 camera. Or at least 1024x768.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+dual Prop SBC w/ 512KB kit $119.95, 2MB memory IO board kit $89.95, both kits $189.95
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • heaterheater Posts: 3,370
    edited 2009-08-19 06:50
    Is this mark in a know position? In one axis or both? Is the paper always in a know position?

    Do you really need a camera?

    Can you get away with a 1 dimensional scan? Say a linear image sensor like CCD191.

    Presumably the paper is some how moved past the sensor and could be scanned by other means, a laser and photo diode say.

    Some of these things may be much easier to interface to a Prop. The average USB web cam is out of the question for the Prop. It is not up to being a USB host.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • RaymanRayman Posts: 14,665
    edited 2009-08-19 10:25
    I've got code for the C328 serial camera here:
    http://www.rayslogic.com/propeller/Programming/Cameras/cameras.htm

    There are higher res versions of this camera too...

    One nice feature is that it can take data as both jpg and raw rgb, so it can be processed with a Propeller...
    There's also a preview mode...

    I'm about to hook up 2 of them to my PSM unit to take 3D stereo time-lapse photography!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • slashsplatslashsplat Posts: 63
    edited 2009-08-19 14:50
    You people are FANTASTIC. What a brain trust.

    The paper is mounted in a frame and needs to be "seen" by the camera as a snapshot of the whole thing. The frame and camera will be stationary in regard to each other and the camera can be mounted at any reasonable distance from the paper, THOUGH it CANNOT be mounted directly ON-AXIS. There needs to be a clear line of sight (on axis) to the paper. So a 1D scan won't work. Lighting should not be a problem.

    I know this would be a slam dunk PC-based project, but I REALLY want to do it with a Propeller...

    I will now start trying to grok the responses so far!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • heaterheater Posts: 3,370
    edited 2009-08-19 15:05
    You wouldn't happen to be shooting at this paper with something would you ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • slashsplatslashsplat Posts: 63
    edited 2009-08-19 15:21
    Uhhh, SHOOTING? Huh? Like a "gun"? Maybe... What gave it away?

    Uh, it is like Airsoft, yeah, that's it... Harmless little balls of paint, yeah, balls of ... well maybe not paint...

    MOLON LAVE

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-19 21:30
    If your looking for something that will shoot something like an airsoft gun at certain targets then try OpenCV on ViewPort with the Propeller. With an XP enabled computer, a webcam, and a Propeller; you can track things in real time on the webcam and send messages to the Propeller trough ViewPort to coordinate the servos. There was a long tread on this a while back but it might have gotten deleted.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-19 22:04
    @slashsplat--you should let me know how it goes. I hope to try the same on a robot eventually, when I finally get it made. I was thinking of using 2 CMUcam2's, but those other ones look better. Thanks for the link Rayman.

    @micro--it's "thread," not "tread."

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • slashsplatslashsplat Posts: 63
    edited 2009-08-20 00:11
    Actually simpler than that.

    I just want to READ the target.

    I would like to use pattern rec to ID the bulletholes and rings, and maybe figger out what the score is. No interest in aiming or shooting anything except a REAL gun at the Range.

    The airsoft comment was a feeble attempt to deflect any anti-firearm salvos. A ruse, as it were...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-20 00:24
    Pi Guy said...
    @micro--it's "thread," not "tread."

    Join the crowd, traitor. skull.gif
    slashsplat said...
    I would like to use pattern rec to ID the bulletholes and rings, and maybe figger out what the score is. No interest in aiming or shooting anything except a REAL gun at the Range.

    Yea, I'm not an anti-gun person myself, and I saw a LOT of hate on the last thread involving the Propeller and weapons.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-20 01:53
    Guns just made it cooler. I guess I can't blame you for that though, I said I was buying an engine for a go-kart a while back when it was really for a robot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • slashsplatslashsplat Posts: 63
    edited 2009-08-20 12:41
    Nice robot that uses a GO-KART engine, you NUTCASE! Post a pic!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-20 15:32
    I posted one of the best pics I have. It isn't quite robotic yet since I accidentally burnt up a few of the mosfets required
    for steering, but I hope to get it functional this weekend if all goes well.

    -Derrick
    1600 x 1200 - 323K
  • slashsplatslashsplat Posts: 63
    edited 2009-08-20 16:08
    Cool. A bit scary, too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-20 16:09
    Subject Change, but is that a goat in the background?!?!?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • slashsplatslashsplat Posts: 63
    edited 2009-08-20 16:12
    Llama?

    A one L lama, he's a priest.
    A two L llama, he's a beast.
    And I will bet a silk pajama,
    there's no such thing as a three L lllama.
    Ogden Nash

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-20 16:47
    slashsplat said...
    Cool. A bit scary, too.

    Yep, especially when it goes out of wack and puts a hole in the chicken coop.

    @mirco--kinda big for a goat, don't you think? At least slashsplat knows what it is.

    -Derrick
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-20 17:04
    You don't see many llamas in a neighborhood. tongue.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    If it's not Parallax then don't even bother.

    I have changed my avatar so that I will no longer be confused with others who use generic avatars (and I'm more of a Prop head then a BS2 nut, anyway)



  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-20 17:10
    There are 2 other people near to us with llamas, but horses are far more common. If you want to know the rarest, there are buffalo about 6 miles away from where I live.

    Edit: perhaps I shouldn't go so off topic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG

    Post Edited (Pi Guy) : 8/20/2009 5:58:41 PM GMT
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-20 17:54
    Slashsplat, is your project just going to count points or will it do something else?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • slashsplatslashsplat Posts: 63
    edited 2009-08-20 21:45
    @3.14159265358979323846 Guy - Yep, count points and track the progress of the aiming effort - sequentially numbering the holes on a display. Especially valuable when the targets are 600 yards away. It would eliminate the need to have a person mark the targets and allow someone to shoot alone, and still see the holes. You cannot see holes from 600y no matter how good the scope is.

    @microcontrolled - Ya gotta live out here in the REAL world. We have llama, horses, goats, pigs, chickens, hunting dogs, coyotes, etc. all around us. We are right next to a Wildlife Management Area (for animals, not people).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • P!-RoP!-Ro Posts: 1,189
    edited 2009-08-20 22:36
    "@3.14159265358979323846 Guy"
    You missed a few digits. Used to know 96--all learned instead of listening to my teach's boring lectures.

    "Ya gotta live out here in the REAL world."
    I agree. Nothin' better than·the good outdoors.
    BTW--do you think this project could help aiming, too? I kinda suck accuracy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • slashsplatslashsplat Posts: 63
    edited 2009-08-21 04:40
    The matches I shoot are pretty basic, using iron sights out to 600 yards. An automated aimer could sure be designed, but is illegal for competition. The use of a device for instant feedback that shows the sequence of the shots WOULD help me know what is happening as I shoot. One course of fire is 20 shots, and to know where you put them in what order is valuable.

    In addition, "calling" the shot is very important. This is when you say where the shot went before you see the result on the target. If you can accurately call the shots, you are paying attention at the time the round is sent, and that - in itself - will improve your shooting. One idea is to have the shooter "call" their shot on the screen, and then keep track of their accuracy. Over time, you should get better at "calling" and that will directly affect your accuracy. It amazed me that I could call the shots as well as I have, as if I had a snapshot of the instant the trigger broke...

    The primary reasons for inaccuracy are easy to work on.
    1. Natural point of aim. If the rifle is being "muscled" into place by your arms and body, you are not creating a structurally sound framework. Muscle positions are not repeatable. You need to use (offhand/standing, sitting, or prone) positions that are rigid and repeatable. If you close your eyes, wave the gun around some, and settle to the most comfortable position, you will probably see that when your eyes open, you are NOT pointing at the target.
    2. Sight alignment. With iron sights, the target must be in a repeatably consistent position in the sight picture.
    3. Trigger control. The movement of the trigger has a FAR great affect on accuracy than any other action in the process, including those above. Most rifles have poor triggers that could be improved easily and cheaply. Good triggers can make even more of a difference. A good AR trigger costs $250 to $300 and makes a huge difference, once you improve the first three.

    Another pet issue for me is rifle weight. A 6 to 8# rifle if any caliber greater than .223 is too light to absorb the recoil. This causes flinch or overly stiff holds (and shaking). My match rifle .223 is 12#, and my .308 is 14#. With both, I can maintain the sight picture AFTER the shot.

    Just some ideas...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-21 05:27
    What's the projectile size (len x dia) and target velocity?

    -Phil
  • slashsplatslashsplat Posts: 63
    edited 2009-08-21 13:33
    A typical .223 (aka 5.56mm) is .223 or so in diameter and travels at about 3K fps as it leaves the barrel. It is about an inch long. The .308 caliber (aka 7.62mm) is .308 and traveling at about 2600 fps. I don't reload so I can't really guess the length.

    Some people shoot .22 Long Rifle rimfire (.22LR) at 1200 fps and 1/2" long. This would only be for 100 and 200 yards.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    slashsplat
    /* Ira Chandler */
    BotConnect.com
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-21 16:03
    Okay, thanks. That's too small and too fast for what I had in mind.

    -Phil
  • Jack BuffingtonJack Buffington Posts: 115
    edited 2013-03-29 13:40
    If you are shooting at a piece of paper in a frame, why not put piezo speakers on the corners of the frame and use them as microphones? By listening for loud noises (or maybe the second loud noise if you are using a real gun) and measuring the time of arrival of the sound at each sensor, you might be able to avoid the whole vision system thing.
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2013-03-29 14:32
    Jack - that is a fascinating idea, and probably far more in-tune with what the prop is capable of.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-03-29 18:15
    Commercial systems for subsonic velocities have a moving ribbon and the microphones measure the sound of the bullet hitting the ribbon. Oehler Research has an acoustic target for supersonic velocities.

    John Abshier

    P.S. Creedmoor Sports sell a Bullseye target system that has a camera down range that wirelessly connects to a laptop at the shooting position. It indicates where you hit and the most recent shot flashes.
Sign In or Register to comment.