OpenCV photometric stereo

Hey everybody,

I am trying to measure the heightmap of a surface in real-time with a webcam. To do so, I was thinking about using a photometric stereo algorithm. By arranging 4 LED strips in the colors red, green, blue and white at known directions in a controlled environment I should be able to get an accurate shading of the surface in the 4 separate color channels. Photometric stereo should enable me to combine those 4 images into a normal map, which can be used to create a height map of the surface.

In GelSight sensors this principle is used in the same way and I found a very cool article for convenience - GelSight Setup. My setup is pretty much the same.

So my question is - does anybody know how to implement such a photometric stereo algorithm inside vvvv gamma? Or is there maybe already an implementation?

I was thinking about using OpenCV as I found some implementations online, but how do I get those implementations on github into vvvv gamma?

OpenCV implementation

Any hint, help or advice is very welcome - Cheers :)

1 Like

Hi @willi_tsb!

Very interesting project. VL.OpenCV uses OpenCVSharp under the hood to wrap all the OpenCV functions, however OpenCVSharp does not necessarily expose all the OpenCV functions to C#.

I would say the first step would be to generate a list of the OpenCV functions used in your Python reference material and then check if they are all available in OpenCVSharp. If they are, that would mean that you should be able to call them from vvvv as well.

Let me know how that goes and I can probably help you move forward.

Cheers!

1 Like