From 531fb73063fec08655c479745182f2f06f57f0a8 Mon Sep 17 00:00:00 2001 From: gac-x04sa Date: Tue, 30 Oct 2018 17:18:50 +0100 Subject: [PATCH] Closedown --- script/cpython/wrapper.py | 5 ++++- script/device/Image.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/script/cpython/wrapper.py b/script/cpython/wrapper.py index aadd198..84924a5 100644 --- a/script/cpython/wrapper.py +++ b/script/cpython/wrapper.py @@ -2,7 +2,10 @@ 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 + #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) diff --git a/script/device/Image.py b/script/device/Image.py index ade855b..bb4d7c3 100644 --- a/script/device/Image.py +++ b/script/device/Image.py @@ -49,13 +49,13 @@ class Image(DeviceBase, Readable): tmp_file = self.pixel.image_root_folder + "tmp/spec_image_info.dat" copyfile(filename, tmp_file) - return img_get_int(tmp_file, threshold1, threshold2, threshold3, threshold4, \ + ret = img_get_int(tmp_file, threshold1, threshold2, threshold3, threshold4, \ self.pixel.IMAGE_HEADER_LENGTH, self.pixel.PIX_XDIM, self.pixel.PIX_YDIM,self.pixel.PIX_COLOR_DEPTH, \ self.roi[0], self.roi[1], self.roi[2], self.roi[3], self.broi[0], self.broi[1], self.broi[2], self.broi[3]) print ret - self.setCache(ret) - return I_sum + self.setCache(ret, None) + return ret def read(self): (I_sum, area_I, thresh1_count, thresh2_count, thresh3_count, thresh4_count, I_sum_bgr, area_bgr) = self.get_int()