Ask Your Question
0

How to reconstruct screen from an image?

asked 2013-11-21 16:59:57 -0600

Mr. Contour gravatar image

updated 2013-11-21 17:26:43 -0600

Hi all, OpenCV beginner here.

I have an image containing a projector screen somewhere in it. The screen is a rectangle, but is distorted by the projection (so not a rectangle in the image). What I need to do is

  1. detect where the projector screen is in the image
  2. cut everything but the screen
  3. warp the screen back into a rectangle

So basically: find the projector screen + reconstruct it as a 2d image, ignoring everything else.

I can control what appears on the projector screen, so I was thinking of displaying red dots at the corners, to make the detection easier. Not sure what to do after that, though.

I googled around how to do this with OpenCV and I'm not any wiser for what I found. Stereo projections and calibration matrices... does anyone have code examples or human-friendly instructions?

I need help both with basic terminology (=what to google for) and how things click together in practice.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-11-22 02:40:21 -0600

JohannesZ gravatar image

Hi!

You need to compute a homography between your projector screen and a top view you have generated. If you are working with red dots, consider two images: the first image is your scene image where you can try to find the red dots - cherckerbaords or markers would be more appropriate by the way! On the second image, define the corners of the projector image and compute a homography between these two corresponding point pairs. 4 correspondences are a minimum!

With this homography, you can warp your projector image in your top-view image. So, try to search for these two subjects.

Hope this helps :-)

edit flag offensive delete link more

Comments

Also, I guess you should consider reordening your steps. I think it makes more sense to first try to rectify your image based on a homography and apply your windows selection and cutting then, then to do it vice versa.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-11-22 04:05:14 -0600 )edit

Question Tools

Stats

Asked: 2013-11-21 16:59:57 -0600

Seen: 436 times

Last updated: Nov 22 '13