From abac8e841db1777adace32360ff2ec73a768a3a7 Mon Sep 17 00:00:00 2001 From: Fixstars-momoko Date: Wed, 23 Oct 2024 13:28:07 -0700 Subject: [PATCH 1/6] added the test for ion-contrib-python using Aravis library --- .github/workflows/develop-Linux.yml | 7 +- .github/workflows/develop-Windows.yml | 9 +- .../testcases/python/arv-fake-camera.xml | 2690 +++++++++++++++++ .../testcases/python/ionkit_contrib_test.py | 39 + 4 files changed, 2741 insertions(+), 4 deletions(-) create mode 100644 installer/testcases/python/arv-fake-camera.xml create mode 100644 installer/testcases/python/ionkit_contrib_test.py diff --git a/.github/workflows/develop-Linux.yml b/.github/workflows/develop-Linux.yml index 4e6d2031..493efcd5 100644 --- a/.github/workflows/develop-Linux.yml +++ b/.github/workflows/develop-Linux.yml @@ -180,7 +180,7 @@ jobs: gendc_separator_version=${gendc_separator_version:1} fi - pip install ion-python==$ionkit_version + pip install ion-contrib-python==$ionkit_version pip install gendc-python==$gendc_separator_version pip install numpy pip install opencv-python @@ -199,6 +199,11 @@ jobs: cd ${{ github.workspace }}/download/installer/testcases/python python ionkit_test.py + - name: Test ion-kit + run: | + cd ${{ github.workspace }}/download/installer/testcases/python + python ionkit_contrib_test.py ${{ github.workspace }}/download/installer/testcases/python/ionkit_contrib_test.py + - name: Test OpenCV run: | cd ${{ github.workspace }}/download/installer/testcases/python diff --git a/.github/workflows/develop-Windows.yml b/.github/workflows/develop-Windows.yml index 30a0b80f..e11fce83 100644 --- a/.github/workflows/develop-Windows.yml +++ b/.github/workflows/develop-Windows.yml @@ -246,19 +246,22 @@ jobs: if ( $gendc_separator_version.StartsWith("v") ){ $gendc_separator_version = $gendc_separator_version.substring(1) } - pip install ion-python==$ionkit_version + pip install ion-contrib-python==$ionkit_version pip install gendc-python==$gendc_separator_version pip install numpy pip install opencv-python pip install aravis-python - - - name: Test ion-kit run: | cd ${{ github.workspace }}/download/installer/testcases/python python ionkit_test.py + - name: Test ion-kit with Aravis + run: | + cd ${{ github.workspace }}/download/installer/testcases/python + python ionkit_contrib_test.py ${{ github.workspace }}/download/installer/testcases/python/ionkit_contrib_test.py + - name: Test OpenCV run: | cd ${{ github.workspace }}/download/installer/testcases/python diff --git a/installer/testcases/python/arv-fake-camera.xml b/installer/testcases/python/arv-fake-camera.xml new file mode 100644 index 00000000..f97a02ae --- /dev/null +++ b/installer/testcases/python/arv-fake-camera.xml @@ -0,0 +1,2690 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + aravis/src/arv-fake-camera.xml at main · AravisProject/aravis · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ Skip to content + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + +
+ + +
+ +
+ +
+ + + + / + + aravis + + + Public +
+ + +
+ +
+ + +
+
+ +
+
+ + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + +

Latest commit

 

History

History
580 lines (504 loc) · 15.6 KB

arv-fake-camera.xml

File metadata and controls

580 lines (504 loc) · 15.6 KB
+
+ + + + +
+ +
+ +
+
+ +
+ +
+

Footer

+ + + + +
+
+ + + + + © 2024 GitHub, Inc. + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + diff --git a/installer/testcases/python/ionkit_contrib_test.py b/installer/testcases/python/ionkit_contrib_test.py new file mode 100644 index 00000000..71c3ba30 --- /dev/null +++ b/installer/testcases/python/ionkit_contrib_test.py @@ -0,0 +1,39 @@ +from ionpy import Param, Buffer, Builder +import os +import sys +import numpy as np + +try: + os.environ["GENICAM_FILENAME"] = sys.argv[1] +except Exception as err: + print(err) + print('Download {} and run python {} '.format('https://github.com/AravisProject/aravis/blob/main/src/arv-fake-camera.xml', os.path.basename(__file__))) + sys.exit(1) + +builder = Builder() +builder.set_target(target='host') +builder.with_bb_module(path='ion-bb') + +num_device = 1 +width = 128 +height = 128 + +node = builder.add('image_io_u3v_cameraN_u8x2') \ + .set_params([Param('num_devices', num_device), + Param("force_sim_mode", True), + Param('width', width), + Param('height', height)]) +output_p = node.get_port('output') + +output_size = (height, width, ) +output_data = np.full(output_size, fill_value=0, dtype=np.uint8) +output = Buffer(array= output_data) + +output_p[0].bind(output) + +for n in range(10): + # running the builder + builder.run() + for i in range(num_device): + print(output_data) + \ No newline at end of file From 6b8c035a9ca8648f526a14c333d8e70c7d72ff7e Mon Sep 17 00:00:00 2001 From: Fixstars-momoko Date: Wed, 23 Oct 2024 13:56:48 -0700 Subject: [PATCH 2/6] fix the format of camera description file --- .../testcases/python/arv-fake-camera.xml | 3270 +++-------------- 1 file changed, 580 insertions(+), 2690 deletions(-) diff --git a/installer/testcases/python/arv-fake-camera.xml b/installer/testcases/python/arv-fake-camera.xml index f97a02ae..22bee147 100644 --- a/installer/testcases/python/arv-fake-camera.xml +++ b/installer/testcases/python/arv-fake-camera.xml @@ -1,2690 +1,580 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - aravis/src/arv-fake-camera.xml at main · AravisProject/aravis · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- Skip to content - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - -
- - -
- -
- -
- - - - / - - aravis - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - -

Latest commit

 

History

History
580 lines (504 loc) · 15.6 KB

arv-fake-camera.xml

File metadata and controls

580 lines (504 loc) · 15.6 KB
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2024 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - -
- -
-
- - - + + + + + + DeviceControl + ImageFormatControl + AcquisitionControl + TransportLayerControl + Debug + + + + + + DeviceVendorName + DeviceModelName + DeviceManufacturerInfo + DeviceID + DeviceVersion + + + + Vendor Name +
0x48
+ 32 + RO + Device +
+ + + Model Name +
0x68
+ 32 + RO + Device +
+ + + Manufacturer Info +
0xa8
+ 48 + RO + Device +
+ + + Device ID +
0xd8
+ 16 + RO + Device +
+ + + Device Version +
0x88
+ 32 + RO + Device +
+ + + + + SensorHeight + SensorWidth + OffsetX + OffsetY + Width + Height + BinningHorizontal + BinningVertical + PixelFormat + + + + Full height of image sensor. + SensorHeightRegister + + + +
0x118
+ 4 + RO + Device + Unsigned + BigEndian +
+ + + Full height of image sensor. + SensorWidthRegister + + + +
0x11c
+ 4 + RO + Device + Unsigned + BigEndian +
+ + + X offset of image, in pixels. + OffsetXRegister + 0 + SensorWidth + 1 + + + +
0x130
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + Y offset of image, in pixels. + OffsetYRegister + 0 + SensorHeight + 1 + + + +
0x134
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + Width of image, in pixels. + WidthRegister + 1 + SensorWidth + 1 + + + +
0x100
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + Height of image, in pixels. + HeightRegister + 1 + SensorHeight + 1 + + + +
0x104
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + Binning in horizontal direction. + BinningHorizontalRegister + 1 + 16 + + + +
0x108
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + Binning in vertical direction. + BinningVerticalRegister + 1 + 16 + + + +
0x10c
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + Pixel format + + 17301515 + + + 17301514 + + + 17301512 + + + 17301513 + + + 17301505 + + + 35127316 + + + 17825799 + + PixelFormatRegister + + + +
0x128
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + + + AcquisitionMode + AcquisitionStart + AcquisitionStop + TriggerSelector + TriggerMode + TriggerSoftware + TriggerSource + TriggerActivation + ExposureTimeAbs + + + + Start acquisition. + AcquisitionCommandRegister + 1 + + + + Stop acquisition. + AcquisitionCommandRegister + 0 + + + +
0x124
+ 4 + WO + Device + Unsigned + BigEndian +
+ + + Acquisition mode + + 1 + + + 2 + + + 3 + + AcquisitionModeRegister + + + +
0x12c
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + AcquisitionFrameRateConverter + + + + Frame rate, in frames per second. + (1000000 / FROM) + (1000000 / TO) + AcquisitionFramePeriod + + + + AcquisitionFramePeriodRegister + 1000 + 10000000 + + + +
0x138
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + + 0 + + + 1 + + TriggerSelectorInteger + + + + 0 + + + + Trigger mode + + 0 + + + 1 + + TriggerModeRegister + + + +
0x300
+ TriggerSelectorInteger + 4 + RW + Device + Unsigned + BigEndian +
+ + + Trigger source + + 0 + + + 1 + + TriggerSourceRegister + + + +
0x304
+ TriggerSelectorInteger + 4 + RW + Device + Unsigned + BigEndian +
+ + + Trigger activation + + 0 + + TriggerActivationRegister + + + +
0x308
+ TriggerSelectorInteger + 4 + RW + Device + Unsigned + BigEndian +
+ + + Generates an internal trigger. TriggerSource must be set to Software. + TriggerSoftwareCommandRegister + 1 + + + +
0x30c
+ 4 + WO + Device + Unsigned + BigEndian +
+ + + Exposure duration, in microseconds. + ExposureTimeAbsConverter + 10.0 + 10000000.0 + + + + FROM + TO + ExposureTimeAbsRegister + + + +
0x120
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + + + GainRaw + GainAuto + + + + Raw gain. + GainRawRegister + 0 + 10 + + + +
0x110
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + Automatic gain mode. + + 1 + + + 3 + + + 2 + + GainAutoRegister + + + +
0x114
+ 4 + RW + Device + Unsigned + BigEndian +
+ + + + + PayloadSize + + + + Width + Height + PixelFormat + WIDTH * HEIGHT * ((PIXELFORMAT>>16)&0xFF) / 8 + + + + Indicates whether a live grab is under way + Invisible + 0 + 0 + 1 + + + + + + TestRegister + + + + TestRegister + 321 + 123 + + + +
0x1f0
+ 4 + RW + Device + Unsigned + BigEndian +
+ + +
0x1f0
+ 4 + RW + Device + BigEndian + + + 31 + 16 + Signed + + + + 15 + 0 + Unsigned + + + + 15 + + + + 31 + 0 + Unsigned + +
+ + +
0x200
+ 32 + RW + Device +
+ + + + + + +
From b83890c5adbfb983b62dea9ea20e3db742421c64 Mon Sep 17 00:00:00 2001 From: Fixstars-momoko Date: Wed, 23 Oct 2024 14:05:08 -0700 Subject: [PATCH 3/6] WIP: fixing the path issue --- .github/workflows/develop-Linux.yml | 3 ++- .github/workflows/develop-Windows.yml | 1 + installer/testcases/python/ionkit_contrib_test.py | 7 ------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/develop-Linux.yml b/.github/workflows/develop-Linux.yml index 493efcd5..4b56e28c 100644 --- a/.github/workflows/develop-Linux.yml +++ b/.github/workflows/develop-Linux.yml @@ -199,9 +199,10 @@ jobs: cd ${{ github.workspace }}/download/installer/testcases/python python ionkit_test.py - - name: Test ion-kit + - name: Test ion-kit with Aravis run: | cd ${{ github.workspace }}/download/installer/testcases/python + export GENICAM_FILENAME=${{ github.workspace }}/download/installer/testcases/python/arv-fake-camera.xml python ionkit_contrib_test.py ${{ github.workspace }}/download/installer/testcases/python/ionkit_contrib_test.py - name: Test OpenCV diff --git a/.github/workflows/develop-Windows.yml b/.github/workflows/develop-Windows.yml index e11fce83..3de9431a 100644 --- a/.github/workflows/develop-Windows.yml +++ b/.github/workflows/develop-Windows.yml @@ -260,6 +260,7 @@ jobs: - name: Test ion-kit with Aravis run: | cd ${{ github.workspace }}/download/installer/testcases/python + $ENV:GENICAM_FILENAME = "${{ github.workspace }}/download/installer/testcases/python/arv-fake-camera.xml" python ionkit_contrib_test.py ${{ github.workspace }}/download/installer/testcases/python/ionkit_contrib_test.py - name: Test OpenCV diff --git a/installer/testcases/python/ionkit_contrib_test.py b/installer/testcases/python/ionkit_contrib_test.py index 71c3ba30..b62e4a5c 100644 --- a/installer/testcases/python/ionkit_contrib_test.py +++ b/installer/testcases/python/ionkit_contrib_test.py @@ -3,13 +3,6 @@ import sys import numpy as np -try: - os.environ["GENICAM_FILENAME"] = sys.argv[1] -except Exception as err: - print(err) - print('Download {} and run python {} '.format('https://github.com/AravisProject/aravis/blob/main/src/arv-fake-camera.xml', os.path.basename(__file__))) - sys.exit(1) - builder = Builder() builder.set_target(target='host') builder.with_bb_module(path='ion-bb') From 65f618ad78f85f266e1cab1f4fa221e2c7e143f2 Mon Sep 17 00:00:00 2001 From: Fixstars-momoko Date: Wed, 23 Oct 2024 14:36:27 -0700 Subject: [PATCH 4/6] show the log for ion-kit with Aravis test --- .github/workflows/develop-Windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/develop-Windows.yml b/.github/workflows/develop-Windows.yml index 3de9431a..48996ff9 100644 --- a/.github/workflows/develop-Windows.yml +++ b/.github/workflows/develop-Windows.yml @@ -261,6 +261,7 @@ jobs: run: | cd ${{ github.workspace }}/download/installer/testcases/python $ENV:GENICAM_FILENAME = "${{ github.workspace }}/download/installer/testcases/python/arv-fake-camera.xml" + $ENV:ION_LOG_LEVEL = "trace" python ionkit_contrib_test.py ${{ github.workspace }}/download/installer/testcases/python/ionkit_contrib_test.py - name: Test OpenCV From d213d5594547efbe907d60d26e01ad023713ecb1 Mon Sep 17 00:00:00 2001 From: Fixstars-momoko Date: Thu, 24 Oct 2024 15:07:38 -0700 Subject: [PATCH 5/6] updated ion-kit version to v3.2.3 --- .github/workflows/develop-Windows.yml | 2 -- installer/config.yml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/develop-Windows.yml b/.github/workflows/develop-Windows.yml index 48996ff9..7e0f4963 100644 --- a/.github/workflows/develop-Windows.yml +++ b/.github/workflows/develop-Windows.yml @@ -259,9 +259,7 @@ jobs: - name: Test ion-kit with Aravis run: | - cd ${{ github.workspace }}/download/installer/testcases/python $ENV:GENICAM_FILENAME = "${{ github.workspace }}/download/installer/testcases/python/arv-fake-camera.xml" - $ENV:ION_LOG_LEVEL = "trace" python ionkit_contrib_test.py ${{ github.workspace }}/download/installer/testcases/python/ionkit_contrib_test.py - name: Test OpenCV diff --git a/installer/config.yml b/installer/config.yml index f53cc72a..246b9bd1 100644 --- a/installer/config.yml +++ b/installer/config.yml @@ -13,9 +13,9 @@ libraries: ion_kit: name: ion-kit - pkg_sha: "41913dcd5c752f2859c48893c8eb1fba04b4bb2faa0e327019ba1a3567c43127" + pkg_sha: "d85c31b70e128b7f22143cb2a91234f5e12e040094b5f74be950bf6620becd55" git_repo: "https://github.com/fixstars/ion-kit.git" - version: "v3.2.2" + version: "v3.2.3" opencv: name: opencv From ae515265a1a336f2426dc98e0cce49e6a675318c Mon Sep 17 00:00:00 2001 From: Fixstars-momoko Date: Thu, 24 Oct 2024 15:40:38 -0700 Subject: [PATCH 6/6] fixed the prev commit --- .github/workflows/develop-Windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/develop-Windows.yml b/.github/workflows/develop-Windows.yml index 7e0f4963..3de9431a 100644 --- a/.github/workflows/develop-Windows.yml +++ b/.github/workflows/develop-Windows.yml @@ -259,6 +259,7 @@ jobs: - name: Test ion-kit with Aravis run: | + cd ${{ github.workspace }}/download/installer/testcases/python $ENV:GENICAM_FILENAME = "${{ github.workspace }}/download/installer/testcases/python/arv-fake-camera.xml" python ionkit_contrib_test.py ${{ github.workspace }}/download/installer/testcases/python/ionkit_contrib_test.py