def tic(): return time.time() def toc(t): return time.time() - t #for i in range(0,10): I1 = io.imread('C:\\Users\\vsimonis\\Documents\\MATLAB\\Intro to Img Processing\\FinalProj\\Media\\ledtest-200.tif') #I1 = ipr.cropBorder(I1, 0, 200) io.imshow(I1) plt.show() t1 = tic() J = ipr.threshHist(I1) print "thresh runtime\t%f" % toc(t1) io.imshow(J) plt.show() t2 = tic() K = ipr.morphOps(J, 5, 1000) print "morph runtime\t%f" % toc(t2) plt.figure() plt.imshow(K, cmap='gray') t3 = tic() x,y = ipr.getCentroid(K) #plt.scatter(x, y) print "centroid runtime\t%f" % toc(t3) #print str(x) + " " + str(y) plt.show()
plt.figure() io.imshow(frame) plt.show() ''' gframe = color.rgb2gray(frame) ''' plt.figure() io.imshow(gframe) plt.show() ''' #J = ipr.minmaxx(gframe) I = ipr.threshHist(gframe) plt.figure() io.imshow(I) plt.show() #ipr.getCentroidFromRaw(frame) ''' imgIn1 = gframe.ravel() #imgOut = np.zeros( (np.shape(imgIn) ) ).ravel() # Histogram analysis to find maximum peak and associated gl