Glass on table - position?

Looking to do a projector project where a person sets a glass on a table - and an animation grows from the glass outward to table edges. Looking for the best way to know the glass has been set on the table (and removed) and then how to get it's position in order to play the video animation at that location.

Was thinking openCV and circle detection... but looking for better, more foolproof, solutions.

Any discussion of image processing methods would be entirely theoretical without some image examples.

Note: reliable detection of objects in images is, in general, an extremely difficult problem.

OpenCV would work well. Ignore the doom and gloom.

OpenCV would work well. Ignore the doom and gloom.

What Arduino are you going to get OpenCV to work on?

I have used OpenCv on a Raspberry Pi 2 running a clock rate of 800MHz and I must say I was very disappointed with it. It was unstable and the GUI didn't function correctly, it was slow, it was not very accurate.

Yeah not an Arduino project with OpenCV, which I assumed was a given seeing as how he's also talking projection and video animation.
Perhaps wrong forum, but we're not that narrow focused as far as I can tell.

Two methods come to mind.

  • A camera under the table - looking for difference in the glass-on-glass transition (prolly IR)
  • Capacitive/ ultrasonic from the edges - detecting interference patterns in the glass surface.

I prefer #2, but more effort - and more accurate.

Could be a crazy difficult project but would be a nice learning curve!

Maybe a camera, such as:
I2C camera TCM8230MD

that can get the pixel data via i2c. There is a pixel pattern (RGB pattern like a Bayer Filter).

You could average the values of each line of pixels. So you have about 1000 16bit averaged values in like a grid system.

You then keep reading each line (an averaging) waiting for a change. May be able to sort something out from this?

While it says it is an I2C camara that is only the control, the image comes out in parallel. So any talk of a raving a line as it comes out is fancifully.

What about a pixy camera? Would need to know more details about the table surface and glass to be sure this would detect properly.

Assuming you can modify the table and the glass is the only object on it:
You could put load cells under the legs of the table, which detect the additional weight of the glass. The distribution of the weight depends on the position of the glass.

lg, couka

Thanks for the suggestions!
I don't believe I can modify the glass or table. And I need any equipment used to sense pretty much hidden from sight.
The Pixy camera looks quite promising. I have done some tests in openCV yesterday using Hough circle finder and it works OK... It may be a little dark in the space this will be, I'm not sure of the lighting yet. Thinking I could use an IR light and IR enabled web cam, if I need to see in the dark.
I wasn't thinking about running OpenCV on Arduino... I just posted here for alternate ideas of detecting the glass on the table using Arduino.

one alternative is to have two ultrasound range detectors in two corners of the table, mounted each on a servo head, and scan the table and triangulate position of an object siting on the table.

Not better for sure, but might be more fun/interesting to do so :stuck_out_tongue:

There's a lot of software out there (free or commercial) for "multitouch" tables. That's basically what you're doing here.

Correction to my previous post... it had been bothering me,
I mentioned capacitive interference on the glass surface, which could be done in another way, but i /meant/ to suggest ultrasonic drivers on two adjacent edges of the glass, then measuring the interference/distortion/reflection of the pulses. A bit like radar in glass