View Single Post
  #5   Spotlight this post!  
Unread 16-02-2010, 09:57
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: making a weighing machine with labview

First, see if you can see the image at all on your computer. Not using LabVIEW, but in a known working program. This means you set up the camera right.

Then, see if you can find a LabVIEW block to get image. This has been troubling me. I can't seem to find a block to Acquire Video from a camera, but I have found many blocks to read and write to files. You might have to go to another library for this.

After that, you use IMAQ to process the image.
Tips for using IMAQ:
*You always must use IMAQ Create every time you need a new image. This creates an image with a name.
*If you do some simple operator that changes the image, e.g. blob detection, you need to create a new image for the output.
*You should be able to use IMAQ Subtract Image to get the difference. Make sure all of the images (A, B, Dst) are the same type, it will go faster.
*Use RGB unless you need HSL. RGB-HSL conversion takes a long time, using IMAQ Cast Image.
*You could probably use IMAQ Subtract and end up with an image that is all black except where the new image is different from the old one. Edge detection would work well there. You would probably want to find the two ends of the line, then find which one is closest to a preset center point. Take the other one, subtract the centerpoint, then use atan2 to find the angle. Once you know the angle you can easily scale it to find the weight.

I'm 15 too, and I've been working with LabVIEW for a little less than a year and a half. You can learn how to do things like use IMAQ by doing exactly what you are doing - write an example that does something, and learn the process and code behind it. All of my experience in IMAQ is FIRST Vision (IMAQ Create, find blobs, reading existing code) and Dashboard display (more IMAQ Create, overlay line, overlay text, etc.).
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote