mWater / mWater-Android-App

An Android App that snaps a picture of a petrifilm, counts the bacteria and posts the counts on a server for the mWater project
https://github.com/AndroidImageProcessing
GNU General Public License v3.0
24 stars 16 forks source link

Find ecoli #22

Closed pakdel closed 12 years ago

pakdel commented 12 years ago

Find blue areas that represent ecoli.

def filterecoli(img):
    red=numpy.compress([False, False, True], img, 2)
    green=numpy.compress([False, True, False], img, 2)
    blue=numpy.compress([True, False, False], img, 2)

    red=192-red.clip(0,192)+64

    # Remove green and blue
    greenblue=numpy.minimum(192-green.clip(0,192), 192-blue.clip(0,192))
    col=(red-greenblue).clip(64,255)-64
    col=255-((col*1).clip(0,255))
    return col

https://github.com/AndroidImageProcessing/AndroidBacteriaImageProcessing/blob/master/data/stage6ecoli.png