Ask Your Question

zorlack's profile - activity

2013-05-20 10:53:53 -0500 received badge  Student (source)
2013-05-20 10:53:50 -0500 received badge  Notable Question (source)
2013-05-20 10:53:50 -0500 received badge  Famous Question (source)
2013-04-09 15:36:53 -0500 received badge  Popular Question (source)
2013-03-31 14:15:46 -0500 received badge  Editor (source)
2013-03-31 13:06:43 -0500 asked a question How do I find lines which overlap blobs?

I have an image which I've binarized and done findBlobs and findLines.

When I render the blobs, it looks like this:

blobs

When I render the lines, it looks like this:

lines

I'm interested in finding out which lines overlap my blobs, but I can't seem to figure out how to do this:

imgBin = img.binarize(binarizeThreshold).invert()
blobs = imgBin.findBlobs(maxsize=maxBlobArea)
lines = imgBin.findLines()
horizontalLines = lines.filter(abs(lines.angle()) < numpy.pi / 8)
for line in horizontalLines:
    print "Line " + str(lineCounter)
    for blob in blobs:
        if line.overlaps(blob):
            print "overlap"
            blob.draw(color=Color.Yellow, width=-1)

Not only does this method not seem to work (it never prints "overlap"), but it seems pretty inefficient.

Am I going about this wrong?

Does line.overlap() work with blobs?

Thanks so much!