diff --git a/script/cpython/image_functions.py b/script/cpython/image_functions.py index 3ea2a39..61d03f3 100644 --- a/script/cpython/image_functions.py +++ b/script/cpython/image_functions.py @@ -15,4 +15,11 @@ def img_get_int(fname, thres1, thres2, thres3, thres4, header, width, height, d # background roi I_sum_bgr = img[by1:by2, bx1:bx2].sum() area_bgr= (bx2 - bx1 + 1) * (by2 - by1 + 1) - return (I_sum, area_I, thresh1_count, thresh2_count, thresh3_count, thresh4_count, I_sum_bgr, area_bgr) \ No newline at end of file + return (I_sum, area_I, thresh1_count, thresh2_count, thresh3_count, thresh4_count, I_sum_bgr, area_bgr) + + +def img_read(fname, header, width, height, depth): + img = numpy.fromfile(fname, dtype=numpy.uint32) + img.shape = height, width + return img + \ No newline at end of file