Skip to content

Commit

Permalink
Use getImg instead of cv2.imread.
Browse files Browse the repository at this point in the history
It would probably work fine for others, but not for me...
  • Loading branch information
joshsomething committed Mar 25, 2018
1 parent 5f4c3bc commit e429376
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions charSim/charPreparer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import numpy as np
import cv2 #for images.
import math #for rand
from getImg.py import getImg
#make a matrix of characters and their filename:
length = 36 #size of matrix

Expand All @@ -47,8 +48,8 @@ def getPair(self):

def getPics(self, one=None, two=None):
if (one == None):
return [cv2.imread("../characters/" + (self.firstChar if self.firstChar != " " else "blank") + ".png", 0), cv2.imread("../characters/" + (self.secondChar if self.secondChar != " " else "blank") + ".png", 0)
return [cv2.imread("../characters/" + (one if one != " " else "blank") + ".png", 0), cv2.imread("../characters/" + (two if two != " " else "blank") + ".png", 0)
return [getImg("../characters/" + (self.firstChar if self.firstChar != " " else "blank") + ".png"), getImg("../characters/" + (self.secondChar if self.secondChar != " " else "blank") + ".png")
return [getImg("../characters/" + (one if one != " " else "blank") + ".png"), getImg("../characters/" + (two if two != " " else "blank") + ".png")

def getDiff(self, one=None, two=None):
charOne, charTwo = getPics(one, two)
Expand Down

0 comments on commit e429376

Please sign in to comment.