Question

I would like to detect the corners of a TV. That is I am recording a video of a TV that plays some movie, and I want to remap what is played on the TV to the movie file. I have been told that the best way to find the corners of the TV is to add some markers ( like april tags) to the corners of the TV screen while I record and then detect them using OpenCV. I have not found such lib/method/tags in OpenCV (I work with Python and Processing/Java). Could someone point me to it? I also welcome other suggestions as to how I could detect the screen reliably. I have tried edge detection but that is not reliable as it sometimes detects stuff based on what is inside the movie. I understand that I can train my program to find an object but I don't want to do training for the calibration process as it adds a big overhead.

Was it helpful?

Solution

You may be able to design a uniquely patterned tag and write a simple algorithm to detect it. As a start, you can take a look at this paper, wherein the tag is recognised accurately using a simplistic but effective method.

You may also be able to detect the TV without tags. You would know roughly what the ratio of the length and height of the TV is. Use the linear hough transform to find prominent lines in the image. Then for every set of 4 lines, find the points of intersection of the 4 lines. Measure the lengths of the line segments, and check if the ratio of lengths of roughly horizontal lines to roughly vertical lines matches the ratio of the length and height of the TV. The set that gives you the closest match is likely to be the TV. If there isn't much pattern in the background, this algorithm will work very fast too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top