|
| 1 | +# OpenCV Test Script for Qualcomm Linux based platform (Yocto) |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +OpenCV Test Scripts automates the validation of one of the OpenCV APIs functionality on the Qualcomm Linux based platform running a Yocto-based Linux system. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- OpenCV core module - ARITHM API |
| 10 | +- accuracy test from ARITHM API |
| 11 | + |
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +Ensure the following components are present in the target Yocto build: |
| 15 | + |
| 16 | +- Compiling the OpenCV Binaries. |
| 17 | +- set up the build from Qualcomm Linux buid guide |
| 18 | +- To enable the tests package, include tests in PACKAGECONFIG in the |
| 19 | + <workspace>/layers/meta-qcom-hwe/recipes-support/opencv/opencv_4.11.0.qcom.bb recipe file as follows. |
| 20 | + |
| 21 | + PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l |
| 22 | + samples tbb gphoto2 tests \ |
| 23 | + ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \ |
| 24 | + |
| 25 | +- To retain test bins, include the following code in the |
| 26 | + <workspace>/layers/meta-qcom-hwe/recipes-support/opencv/opencv_4.11.0.qcom.bb recipe file: |
| 27 | + |
| 28 | + RM_WORK_EXCLUDE += "opencv" |
| 29 | + |
| 30 | +- To Clean OpenCV, run the below command : |
| 31 | + |
| 32 | + bitbake -fc cleanall opencv |
| 33 | + |
| 34 | +- To compile OpenCV, run the following command: |
| 35 | + |
| 36 | + bitbake opencv |
| 37 | + |
| 38 | +- The path to OpenCV bins will be below : |
| 39 | + |
| 40 | + tmp-glibc\work\armv8-2a-qcom-linux\opencv\4.11.0.qcom\build\bin |
| 41 | + |
| 42 | +- Use the scp command to push the required test bin to /usr/bin. ( Test bin should be pushed to /usr/bin/ ) |
| 43 | + |
| 44 | + For example: scp -r opencv_test_core root@[IP-ADDR]:/usr/bin/ |
| 45 | + |
| 46 | + |
| 47 | +## Directory Structure |
| 48 | + |
| 49 | +```bash |
| 50 | +Runner/ |
| 51 | +├── suites/ |
| 52 | +│ ├── Multimedia/ |
| 53 | +│ │ ├── OpenCV/ |
| 54 | +│ │ │ ├── run.sh |
| 55 | + |
| 56 | +``` |
| 57 | + |
| 58 | +## Usage |
| 59 | + |
| 60 | + |
| 61 | +Instructions |
| 62 | + |
| 63 | +1. Copy repo to Target Device: Use scp to transfer the scripts from the host to the target device. The scripts should be copied to any directory on the target device. |
| 64 | + |
| 65 | +2. Verify Transfer: Ensure that the repo have been successfully copied to any directory on the target device. |
| 66 | + |
| 67 | +3. Run Scripts: Navigate to the directory where these files are copied on the target device and execute the scripts as needed. |
| 68 | + |
| 69 | +Run a specific test using: |
| 70 | +--- |
| 71 | +Quick Example |
| 72 | +``` |
| 73 | +git clone <this-repo> |
| 74 | +cd <this-repo> |
| 75 | +scp -r common Runner user@target_device_ip:/<Path in device> |
| 76 | +ssh user@target_device_ip |
| 77 | +cd <Path in device>Runner && ./run-test.sh |
| 78 | +``` |
| 79 | +Sample output: |
| 80 | +``` |
| 81 | +sh-5.2# cd <Path in device>/Runner && ./run-test.sh OpenCV |
| 82 | +[Executing test case: /<Path in device>/Runner/suites/Multimedia/OpenCV/] 1980-01-09 01:31:15 - |
| 83 | +[INFO] 1980-01-09 01:31:15 - ----------------------------------------------------------------------------------------- |
| 84 | +[INFO] 1980-01-09 01:31:15 - -------------------Starting Opencv_core Testcase---------------------------- |
| 85 | +[INFO] 1980-01-09 01:31:15 - Checking if dependency binary is available |
| 86 | +[PASS] 1980-01-08 01:31:15 - Test related dependencies are present. |
| 87 | +... |
| 88 | +[PASS] 1980-01-09 22:31:16 - Opencv_core : Test Passed |
| 89 | +[INFO] 1980-01-09 22:31:16 - -------------------Completed Opencv_core Testcase---------------------------- |
| 90 | +``` |
| 91 | + |
| 92 | +## Notes |
| 93 | + |
| 94 | +- The script does not take any arguments. |
| 95 | +- It validates the presence of required libraries before executing tests. |
| 96 | +- If any critical tool is missing, the script exits with an error message. |
| 97 | + |
| 98 | +## License |
| 99 | + |
| 100 | +SPDX-License-Identifier: BSD-3-Clause-Clear |
| 101 | +(C) Qualcomm Technologies, Inc. and/or its subsidiaries. |
0 commit comments