2D scanner from projector

Hi, I’m working on a way to automate simple 2D projection mappings using openCV.

So far I’ve been able to use ofxCV to detect contours and quads in a given image/video and adjust the content to that quad. Everything happens on the screen, so far so good.

When I move to using a projector and a webcam I run into the camera-projector issue. I need an image of what the projector ‘sees’ so I can process it and feed it to the contour finder. Madmapper has the ‘Spatial Scanner’ feature that does this using a gray code pattern that is projected onto the target surfaces and then using a camera it processes the images to build an image of what the projector sees. You can see how it works HERE.

I’ve looked into ofxGraycode by @elliotwoods but the resulting image after decoding the gray code is a depth map and not what the projector ‘sees’.

So…the workflow should look something like this:

  • Set up webcam and projector.
  • Project the gray code pattern.
  • Decode the images that the webcam captures and get what the projector ‘sees’ ----> Here’s where I need the help :slight_smile:
  • Process the image that the projector ‘sees’ to get contours, quads, etc.
  • Fit the content in the contours.

Any help will be appreciated…or maybe there’s a different approach that I’m not aware of…check out this one for example…

try calling


that’ll give you a photo from the perspective of the projector

also check this function:

feed it a camera image and it will give you that image transformed into projector space (e.g. give it a photo from the camera perspective and it will convert into a photo from projector perspective)

1 Like