
yatakitombi
Philippines
Asked
— Edited
can EZ-Camera read the range of the object? because i need to know if the camera can calculate the distance of the object then grab it...
going with 50.4. dont know for sure. Just helped daughter with History, Algebra and Science homework.
(1+(((3017)/25)/30)) 30
1 plus the known distance * perceived size divided by the known size divided by the known distance times the known distance.
My best guess assuming the object is round or you are looking straight at the side of a square object.
Although, if you were closer than the known distance, I don't think the formula works. You would have to use an if and a comparison to know that the object is closer than the known distance and then script to account. I would have to sit down with some paper to figure the formula for that. It may be as simple as subtracting 1 instead of adding 1 in the formula but I am on a cellphone now and watching American football. Brain shutting off for this evening.
The reality of it is I'm learning this one too and I haven't yet sat down to work it all out (my brain shut off about 2 hours ago, it's gone midnight now, I should be getting some sleep)
The example I used when I posted was explaining how to find the size of an object at a distance rather than the distance of an object from the size but it should all transpose easily enough.
The theory is, the further away an object is the smaller it becomes, therefore the smaller the object the further away it is. If it gets bigger then it is closer than the known distance.
I'm waiting for my Eureka moment on this one, chances are it'll happen on the way to work tomorrow while I'm not thinking.
You would have to know the number of pixels per unit of measure. It would probably be better to use pixels as a unit of measure. Dang it. Brain won't stop thinking about this...
More food for thought here...
Honestly, in thinking about this, if you moved forward toward the object until it is the size you expect, and then pickup the object, I think you will be fine. Go to the largest object, pick it up and then go to the next largest object and pick it up. Do you have to know how far you are from an object or are you trying to use this information for something else?
The ability to be multi-threaded, you can gather input from multiple sensors and make a determination based on multiple pieces of information. You could identify the object and then go toward it until an ir sensor is at a measurement that you know is the distance you need to be at to reach the object. If you can't add an ir sensor, use math to calculate the distance based on the object size. Say the object is 1/2 the size that you expect it to be at a known distance, then you know it is 2 times the know distance away from you. The other option is to look at the object and see if it is larger or smaller than the known size. If it is larger, move back. If it is smaller, move toward it until it is the known size. This is where having the processing power of a computer helps out your robot. The other controllers won't perform these calculations nearly as quickly as yours.
Still digging on this for a solution that doesn't require some of the known variables that you might not know...
d = h * tan a
d is distance h is the height of the camera a is the angle of the camera.
The way this works is by taking a known, height of camera, and a value that can be known, the angle when pointing the camera to the point that the bottom of the object is touching the ground or table the object and the robot are sitting on and calculating the distance.
Maybe using this formula and the formula Rich provided would give you a decent chance of getting a close to accurate distance.
The further the object is away, and uneven ground will skew the calculations. Add a ping sensor and an ir sensor for close up and you should have about everything you need to compare multiple values and get a good distance. I might have to work on this. It's an interesting possibility. It could defiantly be used to help with navigation. The two formulas together could be used to train each other.