Skip to content

Instantly share code, notes, and snippets.

@andrei512
Created November 18, 2014 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrei512/1709c3b6623cc77a4d65 to your computer and use it in GitHub Desktop.
Save andrei512/1709c3b6623cc77a4d65 to your computer and use it in GitHub Desktop.
smen in python
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