From 883ecac1e6d8e43bf21df23cb29ab6c0037636e8 Mon Sep 17 00:00:00 2001 From: Momoko Kono Date: Tue, 21 Nov 2023 09:00:55 +0900 Subject: [PATCH] updated the gain/exposuretime type --- example/u3v_camera1_opencv/u3v_camera1_opencv.cc | 12 ++++++------ example/u3v_camera1_opencv/u3v_camera1_opencv.py | 6 +++--- example/u3v_camera2_opencv/u3v_camera2_opencv.cc | 12 ++++++------ example/u3v_camera2_opencv/u3v_camera2_opencv.py | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/example/u3v_camera1_opencv/u3v_camera1_opencv.cc b/example/u3v_camera1_opencv/u3v_camera1_opencv.cc index 91cff7ac..1c8046fb 100644 --- a/example/u3v_camera1_opencv/u3v_camera1_opencv.cc +++ b/example/u3v_camera1_opencv/u3v_camera1_opencv.cc @@ -19,8 +19,8 @@ using namespace ion; // Resize it according to the resolution of the sensor. const int32_t width = 640; const int32_t height = 480; -int32_t gain = 400; -int32_t exposure = 400; +double gain = 400; +double exposure = 400; #ifdef _WIN32 #define MODULE_NAME "ion-bb.dll" @@ -54,10 +54,10 @@ int main(int argc, char *argv[]) // Define the input port // Port class is used to define dynamic I/O for each node. Port dispose_p{ "dispose", Halide::type_of() }; - Port gain0_p{ "gain0", Halide::type_of() }; - Port gain1_p{ "gain1", Halide::type_of() }; - Port exposure0_p{ "exposure0", Halide::type_of() }; - Port exposure1_p{ "exposure1", Halide::type_of() }; + Port gain0_p{ "gain0", Halide::type_of() }; + Port gain1_p{ "gain1", Halide::type_of() }; + Port exposure0_p{ "exposure0", Halide::type_of() }; + Port exposure1_p{ "exposure1", Halide::type_of() }; // Connect the input port to the Node instance created by b.add(). Node n = b.add("image_io_u3v_camera1_u16x2")(dispose_p, gain0_p, exposure0_p) diff --git a/example/u3v_camera1_opencv/u3v_camera1_opencv.py b/example/u3v_camera1_opencv/u3v_camera1_opencv.py index 8a67d071..13d49cfd 100644 --- a/example/u3v_camera1_opencv/u3v_camera1_opencv.py +++ b/example/u3v_camera1_opencv/u3v_camera1_opencv.py @@ -33,7 +33,7 @@ # Port class would be used to define dynamic O/O for each node. t = Type(TypeCode.Uint, 1, 1) dispose_p = Port('dispose', t, 0) - t = Type(TypeCode.Int, 32, 1) + t = Type(TypeCode.Float, 64, 1) gain0_p = Port('gain0', t, 0) exposure0_p = Port('exposure0', t, 0) @@ -59,8 +59,8 @@ port_map = PortMap() # input values - port_map.set_i32(gain0_p, gain) - port_map.set_i32(exposure0_p, exposure) + port_map.set_f64(gain0_p, gain) + port_map.set_f64(exposure0_p, exposure) # output values buf_size = (width, height, ) diff --git a/example/u3v_camera2_opencv/u3v_camera2_opencv.cc b/example/u3v_camera2_opencv/u3v_camera2_opencv.cc index cc3fb924..305a05d3 100644 --- a/example/u3v_camera2_opencv/u3v_camera2_opencv.cc +++ b/example/u3v_camera2_opencv/u3v_camera2_opencv.cc @@ -19,8 +19,8 @@ using namespace ion; // Resize it according to the resolution of the sensor. const int32_t width = 1920; const int32_t height = 1080; -int32_t gain = 400; -int32_t exposure = 400; +double gain = 400; +double exposure = 400; #ifdef _WIN32 #define MODULE_NAME "ion-bb.dll" @@ -54,10 +54,10 @@ int main(int argc, char *argv[]) // Define the input port // Port class is used to define dynamic I/O for each node. Port dispose_p{ "dispose", Halide::type_of() }; - Port gain0_p{ "gain0", Halide::type_of() }; - Port gain1_p{ "gain1", Halide::type_of() }; - Port exposure0_p{ "exposure0", Halide::type_of() }; - Port exposure1_p{ "exposure1", Halide::type_of() }; + Port gain0_p{ "gain0", Halide::type_of() }; + Port gain1_p{ "gain1", Halide::type_of() }; + Port exposure0_p{ "exposure0", Halide::type_of() }; + Port exposure1_p{ "exposure1", Halide::type_of() }; // Connect the input port to the Node instance created by b.add(). Node n = b.add("image_io_u3v_camera2_u16x2")(dispose_p, gain0_p, gain1_p, exposure0_p, exposure1_p) diff --git a/example/u3v_camera2_opencv/u3v_camera2_opencv.py b/example/u3v_camera2_opencv/u3v_camera2_opencv.py index fc370907..158ca9d6 100644 --- a/example/u3v_camera2_opencv/u3v_camera2_opencv.py +++ b/example/u3v_camera2_opencv/u3v_camera2_opencv.py @@ -33,7 +33,7 @@ # Port class would be used to define dynamic O/O for each node. t = Type(TypeCode.Uint, 1, 1) dispose_p = Port('dispose', t, 0) - t = Type(TypeCode.Int, 32, 1) + t = Type(TypeCode.Float, 64, 1) gain0_p = Port('gain0', t, 0) gain1_p = Port('gain1', t, 0) exposure0_p = Port('exposure0', t, 0) @@ -62,10 +62,10 @@ port_map = PortMap() # input values - port_map.set_i32(gain0_p, gain) - port_map.set_i32(gain1_p, gain) - port_map.set_i32(exposure0_p, exposure) - port_map.set_i32(exposure1_p, exposure) + port_map.set_f64(gain0_p, gain) + port_map.set_f64(gain1_p, gain) + port_map.set_f64(exposure0_p, exposure) + port_map.set_f64(exposure1_p, exposure) # output values buf_size = (width, height, )