go_away

Author Topic: Precision vision  (Read 1050 times)

0 Members and 1 Guest are viewing this topic.

Offline darshanvarierTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Precision vision
« on: June 05, 2012, 11:03:28 PM »
Hi. I'm new to robotics, so I don't know much about the component names.
I'm trying to build an image processing unit, which measures dimensions of objects.
I have very little restriction regarding costs. But I need it to have as much precision as possible(0.03% error) (translates to roughly 3000 pixels lengthwise)
The object to be measured is black in colour, against a white background. Also, it is always at a fixed distance from the camera. And I only need to measure it in one dimension -i.e. Only the width.
I have considered using
1) IP camera
2) webcam
3) Point and shoot camera (a.k.a. compact camera, digicam)
4) Infrared emitter / Sensor
Any other sensor is also acceptable.
The problem is, I cannot figure out how precise these are. Nor do I know whether these can be used for image processing.
Please tell me the pros and cons of these options.
Please note: The object will look like a rectangle when viewed from the camera.

Additional info: The object will vibrate(very little) but it is expected to vibrate at about 10 times per second or something. I wonder if a webcam/digicam can still capture a picture, with required accuracy..
« Last Edit: June 06, 2012, 03:14:02 AM by darshanvarier »

Offline ahudak

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Precision vision
« Reply #1 on: June 06, 2012, 12:24:50 PM »
Hi,

Well.....in a word nope....
1) IP camera
2) webcam
3) Point and shoot camera (a.k.a. compact camera, digicam)

There are 2 problem's with these 3:
A) The object vibrates ten time a second this means your camera needs a frame rate of at least 100ms, 50ms would be better
B) The image processing in these will give you a picture or video file, neither one will be useful to you

4) Infrared emitter / Sensor
A) this is more useful for is something there or not

If I may ask about this "I have very little restriction regarding costs" is this for you or the company you work for?  To do what you want will cost you ALOT, the company that I work for this is the things we do maybe you can find something here :
http://www.horiba.com/us/en/

If you do make something that works for you I would love to hear about it.

Hope this helps
Art

Offline darshanvarierTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Precision vision
« Reply #2 on: June 06, 2012, 10:15:19 PM »
1) webcam
                           Frame rate of 50ms === 20fps
                           I thought a CMUcam can give 30 fps.
2) digi cam
                          I thought these things have a shutter speed of approx 1/2000 seconds.
                          Thats waay faster than 50 ms.
Did I misinterpret your message?
Please respond.

Modification:
Yeah, it is for my company. Hence I get a free robotics project!
« Last Edit: June 06, 2012, 10:46:19 PM by darshanvarier »

Offline ahudak

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Precision vision
« Reply #3 on: June 07, 2012, 01:09:05 PM »
Hi,

You have not really misunderstood, I think a bigger problem than the cameras speed will be the data you get out of it.  I just do not see how you will be able to use the data from a picture or video file to make measurements.  I do not do software or firmware so, maybe I'm wrong about this.

Art 

Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 364
  • Helpful? 10
Re: Precision vision
« Reply #4 on: June 07, 2012, 02:08:16 PM »
You can do it for sure, but the quality of the camera is what will limit the accuracy.  Webcams will *never* have the accuracy you need.

However, as long as you know that it's a fixed distance from the camera, and it's always black on a white background, then a good camera along with OpenCV will be your best bet.  What you need to do is take pixel coordinates and turn them into (x,y,z) coordinates.  This is WAY easier with one camera in your situation: since things are fixed like you say, you only need to calibrate once and be done with it.

The easiest way in the world to do this would be to find the width in pixels, then, since you know the height of the object, you'll be able to calibrate pixel widths to actual widths *at that height*.  Then you're good to go.

I've done it with openCV, it works nicely.  BUT, I cannot stress this enough, do not buy crappy cameras.  Get legit machine vision cameras. 
Current project: tactile sensing systems for multifingered robot hands

Offline darshanvarierTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Precision vision
« Reply #5 on: June 07, 2012, 07:51:46 PM »
I've done it with openCV, it works nicely.  BUT, I cannot stress this enough, do not buy crappy cameras.  Get legit machine vision cameras. 
Legit machine vision cameras?
What are those?
And where can I get them?
And why won't a standard digicam do the task?
isn't 1/2000th of a second fast enough, or is the machine vision camera even faster?

Please respond.

And looking at the previous post, I realized that I didnt mention at what speed it moves, while vibrating. I'm pretty sure, now, that it's the movement speed, and not frequency of vibrations, which decides what I need. So here goes : It moves less than 1mm per swing, so I'll say 10mm/sec
So, for accuracy of 0.01mm, I'll need shutter speed of about 1/1000 sec.
Pretty easy for a digicam, as far as i can think.
as long as I can increase shutter speed(to its max capacity) and program it to click pictures automatically.
Is that possible?

PS: Sorry for underlining the questions, I did it to make them harder to miss.

Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 364
  • Helpful? 10
Re: Precision vision
« Reply #6 on: June 07, 2012, 08:00:43 PM »
IT's not ONLY the speed of the shutter that is important to your task.  A digital camera will suffer from lots of noise, will have crappy optics with lots of distortion (for precision work) and will in general be much harder to calibrate and use consistently.  If you buy good machine vision cameras (what I meant when I said "legit", sorry, sometimes I use weird words for these things :-P ) you won't have these problems.  THey'll have better optics, they will PROBABLY come with software that already does what you're asking etc.  Using machine vision to inspect objects in a manufacturing setting (or, as you appear to be doing, during vibration testing) is a common industry task.

Check out these guys:  http://www.pixelink.com/home.aspx  for an example of the type of thing you should be looking at to get this done properly.  A lot of companies sell software + camera solutions to do your exact task.  These are not cheap, though, and can easily run into the many thousands of dollars for precision systems.

your easiest solution is to do a search on google for "machine vision, industrial" and contact all the companies.  Most don't post prices, you have to request a quote.

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline darshanvarierTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Precision vision
« Reply #7 on: June 07, 2012, 09:53:28 PM »
The website you mentioned also only uses a CMOS/CCD camera. What's so special about these cameras?
and What is this noise you claim comes from a digicam? Please help!
And, oh, last, if possible, can you tell me how the machine vision cameras reduce noise?

Modification: Uhh, and one more thing, when a camera takes a photo of a vibrating object, then can I simply add the white colours together and divide by <average white value, obtained from average of non-black values> ? It's like taking the partial black from the left side, and adding it to the partial black on the right side. This, I assume, will convert 2 half-blacks into 1 full-black pixel. Will this work the way I expect it to work?
I mean, since I didn't understand what's noise, i probably assumed something wrong here.
I read something online about motion deblurring. Does this remove the noise?
« Last Edit: June 07, 2012, 11:00:35 PM by darshanvarier »

Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 364
  • Helpful? 10
Re: Precision vision
« Reply #8 on: June 08, 2012, 07:40:51 AM »
Hm...it really seems like you need to spend a lot more time on the basics of machine vision before you start on a venture for your company that might cost thousands.  I really can't answer ALL of those questions in a single thread, and there are probably others (and lots of books) who are better at explaining it.  I'll give a brief overview of noise, though:

Essentially, all sensors have noise.  This is VERY obvious in cheap cameras.  An easy way to see noise is to take a black piece of paper (not shiny).  Take a picture in low light.  Then, zoom in on the image.  You'll see that the "black" paper is actually a patchwork of ugliness that is APPROXIMATELY black, but not quite.  Some pixels might be brighter, some might be darker, than the actual color.

This is especially irritating when dealing with white.  Typically, you choose a pixel and call that "white", then reference all other pixel values to it.  This is called "white balancing".  But what happens if your white background is noisy?  It might look blue, or something weird.  The problem isn't that you won't be able to find your object, the problem is at the boundaries of the object when things will blur and look ugly.

Machine vision cameras have sophisticated algorithms and filters that remove the noise.  This is ONE of the reasons that you pay more for them.  And before you say "but can't I just make my own noise reduction algorithm?" I want you to consider this: Let's say your company is paying you $20/hour for this project (which is WAY below what you should be getting, by the way).  It might take you 50 hours to get the noise reduction working, since I can tell from your previous posts that you're new to this sort of thing (and no problem with that! we all were at one point).  But that's already $1000!  Why not just spend that money on the camera that has properties you know will work?

On the upside, since you're pretty new to this, why not just get a few cheap webcams and play around?  You'll learn a LOT, even if the precision won't be there, and you'll be much better informed to make a choice about which cameras to buy when you finally bring your product to market.

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline darshanvarierTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Precision vision
« Reply #9 on: June 08, 2012, 10:18:07 PM »
I'm not very good at robotics, but I'm really, really good at algorithms (as in, designing and understanding them, not coding them; but since coders are available really easily, that's not a problem).
About the noise, how much do you think will be there? A blind de-convolution deblurring algorithm will neutralize the noise, will it not?
I tried a simulation, and it could do the right thing with a noise of 20 colour variation (you know, in each pixel, I tried to put a random noise with a standard deviation of 20. The final answer was correct, blurred, or non-blurred.
Please note: I'm not trying to prove myself right, I just want the knowledge that I have not.

PS: A blind deconvolution works by taking several pictures of the same object, then averaging it out by placing it appropriately. Then, it removes the blur, and the webpages relating to deblurring have astounding pictures. Please have a look at google images with the search key: blind deconvolution. You will be really surprised.
And deconvolution is easier and more precise when the object is known, like, say a black object against a white background.

And I'm not so sure about this, but noise is reduced when the exposure time is long enough. I think.
Please respond when you have time.
And, I will also try to read up on machine vision.
Lastly, I have uptil the end of the month to implement this project, which means plenty of time. And I can't take up any other project either.
I'm a student, you see. On an internship.

Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 364
  • Helpful? 10
Re: Precision vision
« Reply #10 on: June 09, 2012, 04:15:49 AM »
I can't really answer "how much noise will there be", since...it's depends on your camera and lopts of other things.  I suggest you just get a camera or two and try it out.  If your algorithms work but aren't to the require precision, it should be just a matter of switching the cameras for better one.s  If the algorithms don't work...it's time to find something new :-P

Noise won't be reduced with increased exposure time.  it will be reduced, in a naive way, by taking lots of exposures and averaging them out.  But filters will be much better, like you described.

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline darshanvarierTopic starter

  • Beginner
  • *
  • Posts: 6
  • Helpful? 0
Re: Precision vision
« Reply #11 on: June 09, 2012, 06:00:16 PM »
Thanks a lot.
I'll try it out, let's see!
I believe a CCD sensor produces less noise than a CMOS sensor; and since it will be receiving continuous power, I don't care about electrical efficiency over noise reduction.

I've taken a few pictures with a 1 MP camera, I'll post the pictures if I get the program working.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Precision vision
« Reply #12 on: June 23, 2012, 08:43:46 PM »
Hi,

[...] But I need it to have as much precision as possible(0.03% error) (translates to roughly 3000 pixels lengthwise)
I hope you realize the issues here?

First, you don't go for "as much as possible", but you define a max. tolerable error and use that as one of the selection criterias.

Second, you cannot just say that 0.03% (300 PPM) equates to 3000 (or even 3,334) pixels, as it only does so if the measured object fills the frame completely (but with nothing "hanging out").

Assuming your standard object are always going to be the same length and the same distance from the cam, you still need a bit more than 3,334 pixels to have some white on each side of the object in the picture. And then your precision will be shot down every now and then due to light reflexes, "half pixels" and lots more - For a more serious approach, use at least 10 times as many pixels as your immediate calculation shows.

If the length of the measured objects varies - the resolution will fall with the same factor as the full size/smaller size.

The cams used for stuff like that is called line scan cams or single line cams, as they are 1xMany pixels (some do have 2, 4 or 8 lines though).


Finally...
Learn the difference between tolerance and precision - they're very different terms.
With an object 3334 px long, you have a resolution of 300 PPM, but your precision will be worse, as the length is an analog size which you quntify into a number of discrete steps, where several factors will influence the amount of light falling on the edges and hence which pixels is considered black or white.
Under ideal circumstances, your precision will be +/- 1 pixel or around 0.1% (when the objects is filling out a 3,334 px sensor) - in real life however...


A couple of things you should ask yourself:
- Why do you want a 300 PPM resolution (not precision)?
- How are the objects measured now?
- What are the resolution and precision of this/these method(s)?
- Do you need it to be much more precise?
Perhaps the answers will point you to something more doable.

In engineering it's very important to find eg. the lowest acceptable precision, rather than gunning for something unrealistic and/or unneeded, as this is often what separates sound engineering from utopian dreams that's nothing but money dumps.

Find the real needs, don't embellish on the numbers, build the darned thing, job done and then it's time for your, well deserved, lunch break ;D
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here

data_list