def getFeatures(img): featureList = [] cv2.imshow("Before ", img) img = normalizer.getNormalizedImage(img) #cv2.imshow("SEEM ME AFTER nomralization",img) #cv2.waitKey() zones = getZonesValue(img) #fourierT = getFourierTransformvalues(img) #print(fourierT) wavelet = waveletTransform(img) for i in zones: featureList.append(i) featureList += crossings(img) featureList.append(getMoment(img)) # for i in fourierT: # featureList.append(i) for i in img: x = get_bit_reversed_list(i) for j in x: featureList.append(j) for i in wavelet: featureList.append(i) return featureList
def getFeatures(img): featureList=[] img=normalizer.getNormalizedImage(img) intersections = getCrossing(img) for i in intersections : featureList.append(i) ''' zones=getZonesValue(img) for i in zones: featureList.append(i) ''' return featureList
def getFeatures(img): featureList = [] # cv2.imshow("SEEM ME Before nomralization", img) img = normalizer.getNormalizedImage(img) # cv2.imshow("SEEM ME AFTER nomralization",img) # cv2.waitKey() zones = getZonesValue(img) for i in zones: featureList.append(i) featureList += crossings(img) featureList += (getMoment(img)) featureList += getEndPointsNIntersectionPoints(img) # featureList+=getFourierTransformvalues(img).tolist() return featureList
print(chr(eclf1.predict(Features.getFeatures(croppedImage))[0]), end=" ") stri = "Candidates after classification, probability wise ::: \n" for i in range(0, min(5, len(sortedLetters))): stri += sortedLetters[i][0] + "(" + str( round(sortedLetters[i][1], 2)) + ")" + " , " fig = plt.figure(figsize=(4.6, 4.6)) ax = fig.add_subplot(1, 2, 1) ax.imshow(cv2.resize(croppedImage, (24, 24)), cmap='gray') ax.set_title("Segmented character") # plt.imshow(croppedImage,cmap='gray') ax = fig.add_subplot(122) ax.imshow(normalizer.getNormalizedImage(croppedImage), cmap='gray') ax.set_title("Thinned Image") plt.suptitle(stri) plt.show() print() '''extractingLines.doit(image) components=componentGetter.getComponents(image) print(len(components)) per=[] pery=[0 for i in range(len(components))] cenx=[];ceny=[] for i in components: per.append(len(i)) x=0.0;y=0.0 for j in i: