Search code examples
c++imageopencvcameraprojector

Getting projected Image pixel locations


I'm working on a thesis that'll need a module that can get the pixel area of a projected image(image that a projector projects). I've got an idea but i don't think it is feasible and accurate as I don't have any experience in computer vision, let me explain the idea.

To get the pixel area or location of let's say, a certain file in a projected image.

  1. Capture the projected image by a camera.
  2. Convert the captured image's resolution to the projector's.
  3. get the file location/pixel area in the captured image.

I haven't tried the idea yet as I don't have a projector right now. Oh and, I'm developing my system in C++. The thesis basically is an interactive projected image by providing touchscreen like functions.

To make it clear, What I'm trying to do is project the computer's screen in a projector and then capture/record it with a camera and get the projected image pixel locations. the problem is how can I get the image pixel location in a projected image with the fact that it is in the real world and it's properties will be transformed such as it's size and dimensions?

If you think the idea is not feasible, please spare some time to comment why and if possible could you please give me an idea on how to handle the problem. I am open for any suggestions.

I'll be glad to answer any questions.


Solution

  • So if you know the projected image size, which I assume is true by (2.) in your question, then you can simply use normalized co-ordinates x' = (x / width), y' = (y / height). Then you can convert a location between any sized images by recovering x = (x'*width), y = (y'height). There will be some rounding errors, but that can't be avoided.

    Cheers

    edit: also assuming the centers are decently aligned.