Files
x04sa-es3/script/cpython/wrapper.py
2018-10-30 18:02:33 +01:00

21 lines
949 B
Python

from jeputils import *
def img_get_int(fname, thres1, thres2, thres3, thres4, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2 ):
ret = call_jep("cpython/image_functions", "img_get_int", [fname, thres1, thres2, thres3, thres4, header, width, height, depth, x1,y1,x2,y2, bx1,by1,bx2,by2])
#return ret
#TODO: Why I_sum ans I_sum_bgr are strings?
(I_sum, area_I, thresh1_count, thresh2_count, thresh3_count, thresh4_count, I_sum_bgr, area_bgr) = ret
return (int(I_sum), area_I, thresh1_count, thresh2_count, thresh3_count, thresh4_count, int(I_sum_bgr), area_bgr)
def img_read(fname, header, width, height, depth):
ret = call_jep("cpython/image_functions", "img_read", [fname, header, width, height, depth])
return ret
#def hfitoff(data, xdeg):
# ret = call_jep("cpython/hfitoff", "hfitoff", [to_npa(data),to_npa(xdeg)])
# return (ret[0], ret[1], ret[2],ret[3], ret[4].data, ret[5].data)