Created
November 18, 2014 18:24
-
-
Save andrei512/1709c3b6623cc77a4d65 to your computer and use it in GitHub Desktop.
smen in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def filterX(image, region): | |
return 1.0 | |
def filterY(image, region): | |
return 2.0 | |
_filters = { | |
"principalComponentX" : filterX, | |
"principalComponentY" : filterY | |
} | |
image = "some image" | |
regions = ["region a", "region b"] | |
def scan_image(image, regions, filters): | |
for f in filters: | |
l = _filters[f] | |
for region in regions: | |
print l(image, region) | |
basicFilters = ["principalComponentX", "principalComponentY"] | |
advancedFiletrs = [] | |
allFilers = _filters.keys() | |
# scan_image(image, regions, basicFilters + advancedFiletrs) | |
scan_image(image, regions, allFilers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment