Skip to content

Fix binding for cv::getRectSubPix #432

Fix binding for cv::getRectSubPix

Fix binding for cv::getRectSubPix #432

Workflow file for this run

name: Windows
on:
pull_request:
push:
branches:
- dev
- release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-windows:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.25.5'
cache: true
- name: Restore cached OpenCV source
uses: actions/cache/restore@v4
id: cache-opencv-source
with:
key: opencv-source-4130-windows-v3
path: |
./opencv/opencv-4.13.0
./opencv/opencv_contrib-4.13.0
- name: Download OpenCV source
if: steps.cache-opencv-source.outputs.cache-hit != 'true'
shell: cmd
run: |
call .\win_download_opencv.cmd "%GITHUB_WORKSPACE%\opencv"
- name: Save cached OpenCV source
uses: actions/cache/save@v4
if: steps.cache-opencv-source.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache-opencv-source.outputs.cache-primary-key }}
path: |
./opencv/opencv-4.13.0
./opencv/opencv_contrib-4.13.0
- name: Restore cached OpenCV build
uses: actions/cache/restore@v4
id: cache-opencv-build
with:
key: opencv-build-4130-windows-v4
path: |
./opencv/build
- name: Build OpenCV
if: steps.cache-opencv-build.outputs.cache-hit != 'true'
shell: cmd
run: |
call .\win_build_opencv.cmd "%GITHUB_WORKSPACE%\opencv"
- name: Save cached OpenCV build
uses: actions/cache/save@v4
if: steps.cache-opencv-build.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache-opencv-build.outputs.cache-primary-key }}
path: |
./opencv/build
- name: Set GoCV env
run: |
go env
echo "CGO_CXXFLAGS=--std=c++11 -DNDEBUG" >> $env:GITHUB_ENV
echo "CGO_CPPFLAGS=-I${env:GITHUB_WORKSPACE}\opencv\build\install\include" >> $env:GITHUB_ENV
echo "CGO_LDFLAGS=-L${env:GITHUB_WORKSPACE}\opencv\build\install\x64\mingw\lib -lopencv_core4130 -lopencv_face4130 -lopencv_videoio4130 -lopencv_imgproc4130 -lopencv_highgui4130 -lopencv_imgcodecs4130 -lopencv_objdetect4130 -lopencv_features2d4130 -lopencv_video4130 -lopencv_dnn4130 -lopencv_xfeatures2d4130 -lopencv_plot4130 -lopencv_tracking4130 -lopencv_img_hash4130 -lopencv_calib3d4130 -lopencv_bgsegm4130 -lopencv_photo4130 -lopencv_aruco4130 -lopencv_wechat_qrcode4130 -lopencv_ximgproc4130 -lopencv_xphoto4130 -lopencv_xobjdetect4130 -lopencv_mcc4130" >> $env:GITHUB_ENV
echo "${env:GITHUB_WORKSPACE}/opencv/build/install/x64/mingw/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Tensorflow test model
run: |
mkdir -p ./testdata
curl -sL https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip > ./testdata/inception5h.zip
unzip -o ./testdata/inception5h.zip tensorflow_inception_graph.pb -d ./testdata
- name: Install ONNX test model
run: |
curl -sL https://huggingface.co/onnxmodelzoo/legacy_models/resolve/main/validated/vision/classification/inception_and_googlenet/googlenet/model/googlenet-9.onnx > ./testdata/googlenet-9.onnx
curl -sL https://huggingface.co/opencv/face_recognition_sface/resolve/main/face_recognition_sface_2021dec.onnx > ./testdata/face_recognition_sface_2021dec.onnx
curl -sL https://huggingface.co/opencv/face_detection_yunet/resolve/main/face_detection_yunet_2023mar.onnx > ./testdata/face_detection_yunet_2023mar.onnx
curl -sL https://huggingface.co/opencv/object_tracking_vittrack/resolve/main/object_tracking_vittrack_2023sep.onnx > ./testdata/object_tracking_vittrack_2023sep.onnx
- name: Install GOTURN test model
shell: bash
run: |
curl -sL https://raw.githubusercontent.com/opencv/opencv_extra/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.prototxt > ./testdata/goturn.prototxt
curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.001 > ./testdata/goturn.caffemodel.zip.001
curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.002 > ./testdata/goturn.caffemodel.zip.002
curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.003 > ./testdata/goturn.caffemodel.zip.003
curl -sL https://github.com/opencv/opencv_extra/raw/c4219d5eb3105ed8e634278fad312a1a8d2c182d/testdata/tracking/goturn.caffemodel.zip.004 > ./testdata/goturn.caffemodel.zip.004
cat ./testdata/goturn.caffemodel.zip.00* > ./testdata/goturn.caffemodel.zip
unzip -o ./testdata/goturn.caffemodel.zip goturn.caffemodel -d ./testdata/
- name: Set GoCV model env
run: |
go env
echo "GOCV_TENSORFLOW_TEST_FILES=${env:GITHUB_WORKSPACE}\testdata" >> $env:GITHUB_ENV
echo "GOCV_ONNX_TEST_FILES=${env:GITHUB_WORKSPACE}\testdata" >> $env:GITHUB_ENV
echo "GOCV_TRACKER_GOTURN_TEST_FILES=${env:GITHUB_WORKSPACE}\testdata" >> $env:GITHUB_ENV
- name: Test GoCV
run: |
go test -v -tags="matprofile,customenv" .
- name: Test GoCV Contrib
run: |
go test -v -tags="matprofile,customenv" ./contrib