I want to use edge detection algorithms from opencv library. Here is a piece of python code:
from opencv.cv import *
from opencv.highgui import *
img = cvLoadIm
For other folks interested in the same type of problem I recommend checking out http://simplecv.org
Here is a bit of code I wrote that does line detection on an image acquired from a webcam. It will even display the image over http.
import SimpleCV
import time
c = SimpleCV.Camera(1)
js = SimpleCV.JpegStreamer()
while(1):
img = c.getImage()
img = img.smooth()
lines = img.findLines(threshold=25,minlinelength=20,maxlinegap=20)
[line.draw(color=(255,0,0)) for line in lines]
#find the avg length of the lines
sum = 0
for line in lines:
sum = line.length() + sum
if sum:
print sum / len(lines)
else:
print "No lines found!"
img.save(js.framebuffer)
time.sleep(0.1)
Check out the project I made this for at http://labs.radiantmachines.com/beard/ It will detect how long your neck beard is :)