Files
dev/script/ms/test.py
2019-08-16 11:22:41 +02:00

34 lines
1.3 KiB
Python

tmp_file = get_context().setup.expandPath("{images}/px.img")
threshold1, threshold2, threshold3, threshold4 = 40, 500, 8000, 100000
PIX_COLOR_DEPTH = 32
PIX_XDIM = 487
PIX_YDIM = 195
image_header_length = 0
roi = [0, 0, 486, 194]
bkroi = [0, 0, 486, 194]
def print_output(ret);
(I_sum, area_I, thresh1_count, thresh2_count, thresh3_count, thresh4_count, I_sum_bgr, area_bgr) = ret
print "Time=",time.time()-start
print "I_sum=",I_sum
print "area_I=",area_I
print "thresh1_count=",thresh1_count
print "thresh2_count=",thresh2_count
print "thresh3_count=",thresh3_count
print "thresh4_count=",thresh4_count
print "I_sum_bgr=",I_sum_bgr
print "area_bgr=",area_bgr
start = time.time()
ret = img_get_int(tmp_file, threshold1, threshold2, threshold3, threshold4, \
image_header_length, PIX_XDIM, PIX_YDIM,PIX_COLOR_DEPTH, \
roi[0], roi[1], roi[2], roi[3], bkroi[0], bkroi[1], bkroi[2], bkroi[3], \
filter_median = False, filter_nsigma = 0)
start = time.time()
ret = img_get_int(tmp_file, threshold1, threshold2, threshold3, threshold4, \
image_header_length, PIX_XDIM, PIX_YDIM,PIX_COLOR_DEPTH, \
roi[0], roi[1], roi[2], roi[3], bkroi[0], bkroi[1], bkroi[2], bkroi[3], \
filter_median = True, filter_nsigma = 30)