示例#1
0
if not image:
	print "Error loading image '%s'" % filename
	print ""
	sys.exit(-1)

threshold1 = 70;
threshold2 = 70;
out = cv.cvCreateImage(cv.cvGetSize(image), 8, 3)
edgeDetector.findEdges(image, out, threshold1, threshold2)

print "Finding the golden means in the picture"

lines = lib.findMeans(cv.cvGetSize(image))

print "Test plot and line scanner methods"
points = lineScanner.naiveLineScanner(out, image, lines[0])

out = highgui.cvLoadImage (filename)
outcopy = highgui.cvLoadImage (filename)

(out,areaOfBlobs) = featureDetector.floodFillLine(out, points, lines[0], lo, up)
copy = cv.cvCopy(out,outcopy)
#print "Finding the golden means in the picture"
#lines = lib.findMeans(cv.cvGetSize(out))

#print "Drawing the means"
#lib.drawLines(lines, out)

#out = out[:,points[0].x :]

listOverSizeOfBlobs = statestik.splitOpBlob(out,outcopy,points,lines[0])
示例#2
0
	print ""
	sys.exit(-1)

threshold1 = 70;
threshold2 = 70;
out = cv.cvCreateImage(cv.cvGetSize(image), 8, 3)
edgeDetector.findEdges(image, out, threshold1, threshold2)

print "Finding the golden means in the picture"

lines = lib.findGoldenMeans(cv.cvGetSize(image))

cut = lines[0]

print "Test plot and line scanner methods"
points = lineScanner.naiveLineScanner(out, image, cut)

out = highgui.cvLoadImage (filename)

(out, components) = featureDetector.floodFillLine(image, out, points, cut, lo, up)

print components[0].area

# Test
comp = cv.CvConnectedComp()
seed = cv.cvPoint(200, 20)
cv.cvFloodFill(image, seed, lib.COL_RED, cv.CV_RGB(lo,lo,lo), cv.CV_RGB(up,up,up),comp)# ,flags, None);
print comp.area

lib.drawBoundingBoxes(out, components)