Question

I am looking for a way to identify a straight line from streaming video coming from the camera. For example, say that I draw a line on a paper. I then want the app to be aware of whether or not the line is visible through the camera (specifically, the center of the camera).

Are there any frameworks that could help me out here?

Was it helpful?

Solution

If all that you want to do is detect the presence of a line within a scene, a Hough transform line detector may be what you want. I have an implementation of this that runs on live video within my open source GPUImage framework.

The GPUImageHoughTransformLineDetector class will take in an image from the camera (or a still image or video) and provide a callback block with the slopes and intercepts of lines it detects within the scene. This is an example of it picking out the edges within this keyboard:

Example of Hough transform line detection

I have to warn you that the detection is a little noisy right now, due to the limited dynamic range in my parallel coordinate space implementation, but I'm trying to clean that up using some iOS 6.0 OpenGL ES extensions.

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