PDA

View Full Version : Coordinates of an object on a passive image



ilovebobcats
06-13-2012, 07:28 AM
I have a few questions regarding a project I'm working on. I need some terms so that I can look it up via Google.

I have a map (picture) of a city that is printed on a wooden table. When I move an object directly over it I want to know the coordinates of the object on the map. And also the angle of the object on the map.

I thought a sort of a scanner is the best solution. That recognizes the part which it scans (part of the map) and translate this to the coordinates and angle. Does somebody know how this technology is called (and maybe a few links to guide me in the right direction)? Or does somebody else has a better idea how this can me realised?

Thanks in advance!

tician
06-13-2012, 10:44 AM
A cool toy/research experiment related to this subject: "Microsoft Surface".

A Kinect or Xtion might be useful for finding angle if the object is large enough and the Kinect is not too close to the map/table (also very useful for finding position of the object if it is detectable).

Finding location is pretty simple if you use just a plain camera(s) fixed above the table. Take a reference image of the table without any objects. Place an object on the table and take a new image. Compare the two, where there is a significant difference in the pixel color values, then it is likely there is an object there. You then use the coordinates of the object's pixels (after a little erosion filtering to get rid of some noise) to find the approximate center of mass/area of the object. From there, you could either print out a location in pixel coordinates or print a location name based on its position on the map. You would have to manually create names for regions of pixel coordinates in the reference image, but that is as simple as giving a few border coordinates and checking if the object's center is inside the region defined by those coordinates.

Finding angle with a basic camera is a bit trickier if you do not use objects that are previously known and well-defined to your program. If the object were unknown, the I suppose that if you had controllable directional lighting along the perimeter of the map, then you could possibly use the shadows cast by the object to determine its shape/dimensions/orientation (structured lighting). There are undoubtedly numerous other methods such as stereo vision, but my mind is fried right now.

jwatte
06-13-2012, 06:22 PM
There was a Playstation Eye game that used (and would recognize) trading cards played in front of the camera.
In general, the simplest set-up is probably one that uses a camera above the table, looking down, and doing image recognition on the surface and objects there.
If the set of objects is limited (playing pieces in a wargame, say,) and the background static (map, say,) then the training needed isn't terribly hard, and if you know how to program, you can probably rig this up yourself using a package such as OpenCV.

ilovebobcats
06-14-2012, 08:09 AM
Thanks for your replies!

Maybe I should have included the image in the first post, sorry for the vague description. Here is a concept render:
http://www.mediafire.com/imageview.php?quickkey=dnsm7ro55u0l7m7&thumb=6


There is a photoframe on the table. The table has the map of a city. I want that if people move the photoframe (digital) on the map the photo will change depending on the position on the table.Camera tracking may be the easiest solution, but I want to look at all the alternative before making the decision. I also rather not have something installed above the table. I hope it can be integrated with the table/photoframe alone.

I also saw the Microsoft Surface but I don't want it to be a screen (it also has to be used for elderly people, and I think large touchscreen might scare them off). I really like the Surface though, cool stuff :P

ilovebobcats
06-14-2012, 08:22 AM
Is the Wacom technology possible or is that very expensive? It is about 1m*2m or something (the table). It does not have that be precise as the Wacom it self. Each 3 cm block or so there is a new photo so the resolution does not have to be that high.

jwatte
06-14-2012, 12:18 PM
There are various magnetic position sensors you can use, in the frame and in the corners of the table.
These sensors are often used in "shoot houses" for military training, for example.

ilovebobcats
06-15-2012, 07:22 AM
There are various magnetic position sensors you can use, in the frame and in the corners of the table.
These sensors are often used in "shoot houses" for military training, for example.

Ah, thanks, I will look into the magnetic position sensors. I found some companies who sell them, maybe I will ask them.

I had a other idea, I don't know if this is possible. Is it possible to create a grid with RFID tags. And put a RFID scanner in the frame. Is there a problem with interference? How close can two RFID be next to each other? I want to chips to be about 3 to 5 cm from each other, is this possible?

jwatte
06-15-2012, 12:26 PM
I would put the sensor/s on the table, rather than the frame. The frame could have four tags, one on each corner, for detection.
You can't do this with common 13 MHz (or 125 kHz) tags, though; you need to get up there in frequency as well as capability of the sensors. You're probably looking at thousands of dollars. If that's in your budget, that sounds like a great idea, though!

tician
06-15-2012, 03:24 PM
Last time I checked ~2-3 years ago, Wacom pen tablets were using inductive sensing. There was a small wire coil in the tip of the pen and a bunch of very small wire coils in a grid covering the active area of the tablet (I think the coils were slightly overlapping in some versions for better position accuracy). The coils in the tablet were connected to control circuitry that sensed the current through each coil in the grid (pretty sure that it was multiplexed and switching/checking at a rather high frequency). By controlling the current pulse(s) produced by the pen, it was also able to send a small amount of information about the status of the pen (buttons and tip pressure). Lots of manufacturers require(d) that the pens have a battery to power the on-board circuitry for reading the buttons and sensing the pressure in the tips, but Wacom actually used the coils in the grid to induce current in the coil in the pen to provide power for the pen's circuitry in addition to sensing its location (and receiving pen button/tip status data). The really nice versions were also able to sense the angle of the pen relative to the tablet surface by very precisely measuring the current in multiple coils (different angles would produce different distributions of current in the coils centered around the pen tip).

You could probably make a pretty simple version for testing with a some magnet wire, resistors, an H-bridge (can be made from discrete transistors if needed), and a pair of microcontrollers.

Ediot: I'm a friggin' idiot who still doesn't have the best grasp of magnetism and induction. Changing magnetic field induces a voltage in a loop of wire, and if the electical circuit is closed will allow a current.
If I am thinking correctly (not likely), each sensing unit of the passive grid would consist of a single coil in series with a single resistor and a rectifier diode (to form a circuit/current loop). One end of the coil would be connected to ground and the other to the anode of the rectifier diode. The cathode of the rectifier diode would be connected to one end of the resistor and the other end of the resistor to ground. The connection point between the cathode and resistor would also be connected to an ADC pin (analog to digital converter). The rectifier diode should aid in preventing a negative voltage (relative to ground) being applied to the ADC pin which would likely cause damage. It would also probably be a good idea to make the connection to the ADC through a second resistor to prevent damage to the ADC pin. A zener diode connecting the pin to ground also wouldn't hurt in preventing damage from over-voltage. I can't recall off the top of my head any of the math for calculating the current induced in a coil by a magnetic field, so I can't give you resistor values yet.

The active device would consist of a microcontroller switching an H-bridge to switch the direction of current through a single coil to create an alternating magnetic field (Edit: Actually, you could probably get away with a single transistor to turn the coil on and off, with this simple growth and decay of current changing the magnetic field sufficiently to induce a current in the passive coils. It would be best to have all of the passive coils set up in an identical manner within the grid so that a single magnetic field will induce a current in the same direction in all the coils. I have the sneaking suspicion that if you were using a single transistor to drive the active coil, then it could only be sensed if it were facing one direction and not the other. If that is the case, then if it is not facing correctly you could just flip the coil). When in close enough proximity to the passive sensing grid, the active coil's changing magnetic field would induce a current in the passive coils. The rectifier diode should allow that current to pass in only one direction and when it does allow it to pass, the current should produce a voltage across the resistor to be sensed by the ADC (V = I * R, and all that).

I know I forgetting some stuff. I think I want to test this out just to see if I got this even remotely correct.

Tommy_T
06-16-2012, 08:22 AM
There are various magnetic position sensors you can use
+1 to jwatte's idea.
two hall sensors place 90deg apart on the edge of your table and a rare earth magnet
as your pointer could turn your table top into a large joystick.

If your pictures are limited you could place proximity switches under the table at each
picture location.

Tommy