|
| 1 | +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. |
| 2 | +# SPDX-License-Identifier: BSD-3-Clause-Clear |
| 3 | + |
| 4 | +# OpenCV Test Script for Qualcomm Linux based platform (Yocto) |
| 5 | + |
| 6 | +## Overview |
| 7 | + |
| 8 | +OpenCV script automates the validation of one of the OpenCV APIs functionality on the Qualcomm Linux based platform running a Yocto-based Linux system. |
| 9 | + |
| 10 | +## Features |
| 11 | + |
| 12 | +- OpenCV core module - ARITHM API |
| 13 | +- accuracy test from ARITHM API |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +Ensure the following components are present in the target Yocto build: |
| 18 | + |
| 19 | +- Compiling the OpenCV Binaries. |
| 20 | +- set up the build from Qualcomm Linux buid guide |
| 21 | +- To enable the tests package, include tests in PACKAGECONFIG in the |
| 22 | + <workspace>/layers/meta-qcom-hwe/recipes-support/opencv/opencv_4.11.0.qcom.bb recipe file as follows. |
| 23 | + |
| 24 | + PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l |
| 25 | + samples tbb gphoto2 tests \ |
| 26 | + ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \ |
| 27 | + |
| 28 | +- To retain test bins, include the following code in the |
| 29 | + <workspace>/layers/meta-qcom-hwe/recipes-support/opencv/opencv_4.11.0.qcom.bb recipe file: |
| 30 | + |
| 31 | + RM_WORK_EXCLUDE += "opencv" |
| 32 | + |
| 33 | +- To Clean OpenCV, run the below command : |
| 34 | + |
| 35 | + bitbake -fc cleanall opencv |
| 36 | + |
| 37 | +- To compile OpenCV, run the following command: |
| 38 | + |
| 39 | + bitbake opencv |
| 40 | + |
| 41 | +- The path to OpenCV bins will be below : |
| 42 | + |
| 43 | + tmp-glibc\work\armv8-2a-qcom-linux\opencv\4.11.0.qcom\build\bin |
| 44 | + |
| 45 | +- Use the scp command to push the required test bin to /usr/bin. ( Test bin should be pushed to /usr/bin/ ) |
| 46 | + |
| 47 | + For example: scp -r opencv_test_core root@[IP-ADDR]:/usr/bin/ |
| 48 | + |
| 49 | + |
| 50 | +## Directory Structure |
| 51 | + |
| 52 | +```bash |
| 53 | +Runner/ |
| 54 | +├── suites/ |
| 55 | +│ ├── Multimedia/ |
| 56 | +│ │ ├── OpenCV/ |
| 57 | +│ │ │ ├── run.sh |
| 58 | + |
| 59 | +``` |
| 60 | + |
| 61 | +## Usage |
| 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 the /var directory on the target device. |
| 64 | + |
| 65 | +2. Verify Transfer: Ensure that the repo have been successfully copied to the /var directory on the target device. |
| 66 | + |
| 67 | +3. Run Scripts: Navigate to the /var directory 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:/var |
| 76 | +ssh user@target_device_ip |
| 77 | +cd /var/Runner && ./run-test.sh |
| 78 | +``` |
| 79 | +Sample output: |
| 80 | +``` |
| 81 | +sh-5.2# cd /var/Runner && ./run-test.sh OpenCV |
| 82 | +[Executing test case: /var/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. |
0 commit comments