コード例 #1
0
   filenameBk = sys.argv[2]
   print("background file: "+filenameBk)
   Xi = pyl.imread(filenameIm)
   Xb = pyl.imread(filenameBk)
   X=Xi-Xb










Xc=imgtl.RemoveEdge(X, 0) 
plt.imshow(Xc)
norm0, meanx0, meany0, meanI0, stdx0, stdy0, stdI0, correl0, Wx0, Wy0, averImage0, IMGf = \
	      imgtl.window_scan2dthreshold(Xc, 1., 50, 0.00)



plt.figure()
plt.subplot (2,2,1)
plt.plot (Wx0, averImage0,'o')
plt.subplot (2,2,2)
plt.plot (Wx0, stdx0,'ro')
plt.plot (Wx0, stdy0,'go')
plt.subplot (2,2,3)
plt.plot (Wx0, correl0,'ro')
plt.subplot (2,2,4)
コード例 #2
0
        IMG = IMGT - BKGD

# display raw image
plt.figure()
plt.subplot(2, 2, 1)
imgtl.DisplayImage(IMG)
plt.title('raw data::' + FilenameBeam, fontsize=FTsize)
plt.axis('off')
print 'size raw:', np.shape(IMG)
# crop image
#    plt.figure()
plt.subplot(2, 2, 2)
# need to fix autocrop not to see image
#TODOFIX
# IMGc=imgtl.AutoCrop(IMG, bbox)
IMGc = imgtl.RemoveEdge(IMG, 100)
print 'size removed:', np.shape(IMGc)
imgtl.DisplayCalibratedProj(IMGc, cal, fudge)
plt.title('cropped' + FilenameBeam, fontsize=FTsize)
plt.axis('off')
# threshold image
#    plt.figure()
plt.subplot(2, 2, 3)
IMGt = ndimage.gaussian_filter(IMGc, 0)
# imgtl.Threshold(IMGc, threshold)
imgtl.DisplayCalibratedProj(IMGt, cal, fudge)
plt.title('cropped::' + FilenameBeam, fontsize=FTsize)
plt.axis('off')
# compute profiles
histx, histy, x, y = imgtl.GetImageProjection(IMGt, cal)
#    plt.figure()