Skip to content

Commit

Permalink
Merge pull request #1 from baroobob/master
Browse files Browse the repository at this point in the history
Disable dithering
  • Loading branch information
iandanforth committed Jun 6, 2014
2 parents 61a2155 + e1aa9ff commit 3794590
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion exampleView.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from sp_viewer import SPViewer
from nupic.research.spatial_pooler import SpatialPooler
import pygame

def main():

Expand All @@ -25,7 +26,7 @@ def main():
numActiveColumnsPerInhArea = 1, # Only one feature active at a time
# All input activity can contribute to feature output
stimulusThreshold = 0,
synPermInactiveDec = 0.01,
synPermInactiveDec = 0.1,
synPermActiveInc = 0.1,
synPermConnected = 0.1, # Connected threshold
maxBoost = 3,
Expand All @@ -42,6 +43,9 @@ def main():
replayDelay = .1)
viewer.run()

finalWindow = viewer.screen
pygame.image.save(finalWindow, "screenshot.jpg")


if __name__ == "__main__":
main()
Expand Down
2 changes: 1 addition & 1 deletion sp_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _convertToVector(self, image):
Returns a bit vector representation (list of ints) of a PIL image.
'''
# Convert the image to black and white
image = image.convert('1')
image = image.convert('1',dither=Image.NONE)
# Pull out the data, turn that into a list, then a numpy array,
# then convert from 0 255 space to binary with a threshold.
# Finnally cast the values into a type CPP likes
Expand Down

0 comments on commit 3794590

Please sign in to comment.