hybridgroup / gocv

Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, and OpenCV Contrib.
https://gocv.io
Other
6.58k stars 861 forks source link

TestTrackbar fails on wayland #560

Open mh-cbon opened 4 years ago

mh-cbon commented 4 years ago

TestTrackbar is failing using wayland, with below error. Although, the lib is working fine.

Description

=== RUN   TestTrackbar
terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.0.1) /home/mh-cbon/opencv4/opencv-4.0.1/modules/highgui/src/window_QT.cpp:1220: error: (-27:Null pointer) NULL value pointer in function 'addSlider2'

Steps to Reproduce

$ go test -v . ./contrib
=== RUN   TestFisheyeUndistorImage
--- PASS: TestFisheyeUndistorImage (0.75s)
=== RUN   TestFisheyeUndistorImageWithParams
--- PASS: TestFisheyeUndistorImageWithParams (0.84s)
=== RUN   TestInitUndistortRectifyMap
roi:(92,108)-(1199,618)
--- PASS: TestInitUndistortRectifyMap (0.06s)
=== RUN   TestUndistort
--- PASS: TestUndistort (0.08s)
=== RUN   TestMat
--- PASS: TestMat (0.00s)
=== RUN   TestMatFromBytesWithEmptyByteSlise
--- PASS: TestMatFromBytesWithEmptyByteSlise (0.00s)
=== RUN   TestMatWithSize
--- PASS: TestMatWithSize (0.00s)
=== RUN   TestMatWithSizeFromScalar
--- PASS: TestMatWithSizeFromScalar (0.00s)
=== RUN   TestMatFromPtr
--- PASS: TestMatFromPtr (0.00s)
=== RUN   TestMatClone
--- PASS: TestMatClone (0.00s)
=== RUN   TestMatCopyTo
--- PASS: TestMatCopyTo (0.00s)
=== RUN   TestMatCopyToWithMask
--- PASS: TestMatCopyToWithMask (0.00s)
=== RUN   TestMatToBytes
--- PASS: TestMatToBytes (0.00s)
=== RUN   TestMatDataPtr
=== RUN   TestMatDataPtr/Uint8
=== RUN   TestMatDataPtr/Int8
=== RUN   TestMatDataPtr/Uint16
=== RUN   TestMatDataPtr/Int16
=== RUN   TestMatDataPtr/Float32
=== RUN   TestMatDataPtr/Float64
--- PASS: TestMatDataPtr (0.00s)
    --- PASS: TestMatDataPtr/Uint8 (0.00s)
    --- PASS: TestMatDataPtr/Int8 (0.00s)
    --- PASS: TestMatDataPtr/Uint16 (0.00s)
    --- PASS: TestMatDataPtr/Int16 (0.00s)
    --- PASS: TestMatDataPtr/Float32 (0.00s)
    --- PASS: TestMatDataPtr/Float64 (0.00s)
=== RUN   TestMatRegion
--- PASS: TestMatRegion (0.00s)
=== RUN   TestMatReshape
--- PASS: TestMatReshape (0.00s)
=== RUN   TestMatPatchNaNs
--- PASS: TestMatPatchNaNs (0.00s)
=== RUN   TestMatConvert
--- PASS: TestMatConvert (0.00s)
=== RUN   TestMatConvertFp16
--- PASS: TestMatConvertFp16 (0.00s)
=== RUN   TestMatSqrt
--- PASS: TestMatSqrt (0.00s)
=== RUN   TestMatMean
--- PASS: TestMatMean (0.00s)
=== RUN   TestMatMeanWithMask
--- PASS: TestMatMeanWithMask (0.00s)
=== RUN   TestLUT
--- PASS: TestLUT (0.01s)
=== RUN   TestMatAccessors
--- PASS: TestMatAccessors (0.00s)
=== RUN   TestMatMutators
=== RUN   TestMatMutators/SetTo
=== RUN   TestMatMutators/SetUCharAt
=== RUN   TestMatMutators/SetUCharAt3
=== RUN   TestMatMutators/SetSCharAt
=== RUN   TestMatMutators/SetSCharAt3
=== RUN   TestMatMutators/SetShortAt
=== RUN   TestMatMutators/SetShortAt3
=== RUN   TestMatMutators/SetIntAt
=== RUN   TestMatMutators/SetIntAt3
=== RUN   TestMatMutators/SetFloatAt
=== RUN   TestMatMutators/SetFloatAt3
=== RUN   TestMatMutators/SetDoubleAt
=== RUN   TestMatMutators/SetDoubleAt3
=== RUN   TestMatMutators/AddUChar
=== RUN   TestMatMutators/SubtractUChar
=== RUN   TestMatMutators/MultiplyUChar
=== RUN   TestMatMutators/DivideUChar
=== RUN   TestMatMutators/AddFloat
=== RUN   TestMatMutators/SubtractFloat
=== RUN   TestMatMutators/MultiplyFloat
=== RUN   TestMatMutators/DivideFloat
--- PASS: TestMatMutators (0.00s)
    --- PASS: TestMatMutators/SetTo (0.00s)
    --- PASS: TestMatMutators/SetUCharAt (0.00s)
    --- PASS: TestMatMutators/SetUCharAt3 (0.00s)
    --- PASS: TestMatMutators/SetSCharAt (0.00s)
    --- PASS: TestMatMutators/SetSCharAt3 (0.00s)
    --- PASS: TestMatMutators/SetShortAt (0.00s)
    --- PASS: TestMatMutators/SetShortAt3 (0.00s)
    --- PASS: TestMatMutators/SetIntAt (0.00s)
    --- PASS: TestMatMutators/SetIntAt3 (0.00s)
    --- PASS: TestMatMutators/SetFloatAt (0.00s)
    --- PASS: TestMatMutators/SetFloatAt3 (0.00s)
    --- PASS: TestMatMutators/SetDoubleAt (0.00s)
    --- PASS: TestMatMutators/SetDoubleAt3 (0.00s)
    --- PASS: TestMatMutators/AddUChar (0.00s)
    --- PASS: TestMatMutators/SubtractUChar (0.00s)
    --- PASS: TestMatMutators/MultiplyUChar (0.00s)
    --- PASS: TestMatMutators/DivideUChar (0.00s)
    --- PASS: TestMatMutators/AddFloat (0.00s)
    --- PASS: TestMatMutators/SubtractFloat (0.00s)
    --- PASS: TestMatMutators/MultiplyFloat (0.00s)
    --- PASS: TestMatMutators/DivideFloat (0.00s)
=== RUN   TestMatAbsDiff
--- PASS: TestMatAbsDiff (0.00s)
=== RUN   TestMatAdd
--- PASS: TestMatAdd (0.00s)
=== RUN   TestMatAddWeighted
--- PASS: TestMatAddWeighted (0.00s)
=== RUN   TestMatBitwiseOperations
--- PASS: TestMatBitwiseOperations (0.00s)
=== RUN   TestMatBitwiseOperationsWithMasks
--- PASS: TestMatBitwiseOperationsWithMasks (0.00s)
=== RUN   TestMatInRange
--- PASS: TestMatInRange (0.00s)
=== RUN   TestMatInRangeWithScalar
--- PASS: TestMatInRangeWithScalar (0.00s)
=== RUN   TestMatDCT
--- PASS: TestMatDCT (0.00s)
=== RUN   TestMatDFT
--- PASS: TestMatDFT (0.00s)
=== RUN   TestMatDivide
--- PASS: TestMatDivide (0.00s)
=== RUN   TestMeanStdDev
--- PASS: TestMeanStdDev (0.00s)
=== RUN   TestMatMerge
--- PASS: TestMatMerge (0.00s)
=== RUN   TestMatMulSpectrums
--- PASS: TestMatMulSpectrums (0.00s)
=== RUN   TestMatMultiply
--- PASS: TestMatMultiply (0.00s)
=== RUN   TestMatNormalize
--- PASS: TestMatNormalize (0.00s)
=== RUN   TestMatPerspectiveTransform
--- PASS: TestMatPerspectiveTransform (0.00s)
=== RUN   TestMatSolve
--- PASS: TestMatSolve (0.00s)
=== RUN   TestSolveCubic
--- PASS: TestSolveCubic (0.00s)
=== RUN   TestSolvePoly
--- PASS: TestSolvePoly (0.00s)
=== RUN   TestMatReduceToSingleRow
--- PASS: TestMatReduceToSingleRow (0.00s)
=== RUN   TestMatReduceToSingleColumn
--- PASS: TestMatReduceToSingleColumn (0.00s)
=== RUN   TestRepeat
--- PASS: TestRepeat (0.00s)
=== RUN   TestScaleAdd
--- PASS: TestScaleAdd (0.00s)
=== RUN   TestSetIdentity
--- PASS: TestSetIdentity (0.00s)
=== RUN   TestMatSortEveryRowDescending
--- PASS: TestMatSortEveryRowDescending (0.00s)
=== RUN   TestMatSortIdxEveryRowDescending
--- PASS: TestMatSortIdxEveryRowDescending (0.00s)
=== RUN   TestMatSplit
--- PASS: TestMatSplit (0.01s)
=== RUN   TestMatSubtract
--- PASS: TestMatSubtract (0.00s)
=== RUN   TestMatTrace
--- PASS: TestMatTrace (0.00s)
=== RUN   TestMatTransform
--- PASS: TestMatTransform (0.00s)
=== RUN   TestMatTranspose
--- PASS: TestMatTranspose (0.00s)
=== RUN   TestPolarToCart
--- PASS: TestPolarToCart (0.00s)
=== RUN   TestMatPow
--- PASS: TestMatPow (0.00s)
=== RUN   TestMatSum
--- PASS: TestMatSum (0.00s)
=== RUN   TestTermCriteria
--- PASS: TestTermCriteria (0.00s)
=== RUN   TestScalar
--- PASS: TestScalar (0.00s)
=== RUN   TestToCPoints
--- PASS: TestToCPoints (0.00s)
=== RUN   TestToCStrings
--- PASS: TestToCStrings (0.00s)
=== RUN   TestMatBatchDistance
--- PASS: TestMatBatchDistance (0.00s)
=== RUN   TestMatBorderInterpolate
--- PASS: TestMatBorderInterpolate (0.00s)
=== RUN   TestMatCalcCovarMatrix
--- PASS: TestMatCalcCovarMatrix (0.00s)
=== RUN   TestMatCartToPolar
--- PASS: TestMatCartToPolar (0.00s)
=== RUN   TestMatCheckRange
--- PASS: TestMatCheckRange (0.00s)
=== RUN   TestMatCompleteSymm
--- PASS: TestMatCompleteSymm (0.00s)
=== RUN   TestMatConvertScaleAbs
--- PASS: TestMatConvertScaleAbs (0.00s)
=== RUN   TestMatCopyMakeBorder
--- PASS: TestMatCopyMakeBorder (0.00s)
=== RUN   TestMatDeterminant
--- PASS: TestMatDeterminant (0.00s)
=== RUN   TestMatEigen
--- PASS: TestMatEigen (0.00s)
=== RUN   TestMatEigenNonSymmetric
--- PASS: TestMatEigenNonSymmetric (0.00s)
=== RUN   TestMatExp
--- PASS: TestMatExp (0.00s)
=== RUN   TestMatExtractChannel
--- PASS: TestMatExtractChannel (0.00s)
=== RUN   TestMatFindNonZero
--- PASS: TestMatFindNonZero (0.00s)
=== RUN   TestMatFlip
--- PASS: TestMatFlip (0.00s)
=== RUN   TestMatPhase
--- PASS: TestMatPhase (0.00s)
=== RUN   TestMatGemm
--- PASS: TestMatGemm (0.00s)
=== RUN   TestMatHconcat
--- PASS: TestMatHconcat (0.00s)
=== RUN   TestMatVconcat
--- PASS: TestMatVconcat (0.00s)
=== RUN   TestRotate
--- PASS: TestRotate (0.00s)
=== RUN   TestMatIdct
--- PASS: TestMatIdct (0.00s)
=== RUN   TestMatIdft
--- PASS: TestMatIdft (0.00s)
=== RUN   TestMatInsertChannel
--- PASS: TestMatInsertChannel (0.00s)
=== RUN   TestMatInvert
--- PASS: TestMatInvert (0.00s)
=== RUN   TestKMeans
--- PASS: TestKMeans (0.00s)
=== RUN   TestKMeansPoints
--- PASS: TestKMeansPoints (0.00s)
=== RUN   TestMatLog
--- PASS: TestMatLog (0.00s)
=== RUN   TestMatMagnitude
--- PASS: TestMatMagnitude (0.00s)
=== RUN   TestMatMax
--- PASS: TestMatMax (0.00s)
=== RUN   TestMatMin
--- PASS: TestMatMin (0.00s)
=== RUN   TestMatMinMaxIdx
--- PASS: TestMatMinMaxIdx (0.00s)
=== RUN   TestMatToImage
--- PASS: TestMatToImage (0.00s)
=== RUN   TestImageToMatRGBA
--- PASS: TestImageToMatRGBA (0.07s)
=== RUN   TestImageToMatRGB
--- PASS: TestImageToMatRGB (0.09s)
=== RUN   TestImageGrayToMatGray
--- PASS: TestImageGrayToMatGray (0.12s)
=== RUN   TestGetVecfAt
--- PASS: TestGetVecfAt (0.00s)
=== RUN   TestGetVeciAt
--- PASS: TestGetVeciAt (0.00s)
=== RUN   TestGetTickFrequencyCount
--- PASS: TestGetTickFrequencyCount (0.00s)
=== RUN   TestReadNet
--- SKIP: TestReadNet (0.00s)
    dnn_test.go:83: Unable to locate Caffe model files for tests
=== RUN   TestCaffe
--- SKIP: TestCaffe (0.00s)
    dnn_test.go:158: Unable to locate Caffe model files for tests
=== RUN   TestTensorflow
--- SKIP: TestTensorflow (0.00s)
    dnn_test.go:233: Unable to locate Tensorflow model file for tests
=== RUN   TestBlobFromImages
--- PASS: TestBlobFromImages (0.01s)
=== RUN   TestImagesFromBlob
--- PASS: TestImagesFromBlob (0.01s)
=== RUN   TestGetBlobChannel
--- PASS: TestGetBlobChannel (0.00s)
=== RUN   TestGetBlobSize
--- PASS: TestGetBlobSize (0.00s)
=== RUN   TestParseNetBackend
--- PASS: TestParseNetBackend (0.00s)
=== RUN   TestParseNetTarget
--- PASS: TestParseNetTarget (0.00s)
=== RUN   TestFP16BlobFromImage
--- PASS: TestFP16BlobFromImage (0.00s)
=== RUN   TestAKAZE
--- PASS: TestAKAZE (0.33s)
=== RUN   TestAgastFeatureDetector
--- PASS: TestAgastFeatureDetector (0.02s)
=== RUN   TestBRISK
--- PASS: TestBRISK (0.83s)
=== RUN   TestFastFeatureDetector
--- PASS: TestFastFeatureDetector (0.01s)
=== RUN   TestFastFeatureDetectorWithParams
--- PASS: TestFastFeatureDetectorWithParams (0.01s)
=== RUN   TestGFTTDetector
--- PASS: TestGFTTDetector (0.03s)
=== RUN   TestKAZE
--- PASS: TestKAZE (2.15s)
=== RUN   TestMSER
--- PASS: TestMSER (0.42s)
=== RUN   TestORB
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
--- PASS: TestORB (1.37s)
=== RUN   TestSimpleBlobDetector
--- PASS: TestSimpleBlobDetector (0.05s)
=== RUN   TestSimpleBlobDetectorWithParams
--- PASS: TestSimpleBlobDetectorWithParams (0.03s)
=== RUN   TestSimpleBlobDetectorParams
--- PASS: TestSimpleBlobDetectorParams (0.00s)
=== RUN   TestBFMatcher
--- PASS: TestBFMatcher (0.18s)
=== RUN   TestDrawKeyPoints
--- PASS: TestDrawKeyPoints (0.01s)
=== RUN   TestWindow
QSocketNotifier: Can only be used with threads started with QThread
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
--- PASS: TestWindow (0.57s)
=== RUN   TestIMShow
--- PASS: TestIMShow (0.04s)
=== RUN   TestSelectROI
--- SKIP: TestSelectROI (0.00s)
    highgui_test.go:73: TODO: figure out how to implement a test that can exercise the GUI
=== RUN   TestSelectROIs
--- SKIP: TestSelectROIs (0.00s)
    highgui_test.go:77: TODO: figure out how to implement a test that can exercise the GUI
=== RUN   TestTrackbar
terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.0.1) /home/mh-cbon/opencv4/opencv-4.0.1/modules/highgui/src/window_QT.cpp:1220: error: (-27:Null pointer) NULL value pointer in function 'addSlider2'

FAIL    gocv.io/x/gocv  10.626s
=== RUN   TestLBPHFaceRecognizer_Methods
--- PASS: TestLBPHFaceRecognizer_Methods (0.43s)
=== RUN   TestHashes
=== RUN   TestHashes/PHash
=== RUN   TestHashes/AverageHash
=== RUN   TestHashes/BlockMeanHash
=== RUN   TestHashes/ColorMomentHash
=== RUN   TestHashes/MarrHidlrethHash
=== RUN   TestHashes/RadialVarianceHash
--- PASS: TestHashes (0.14s)
    --- PASS: TestHashes/PHash (0.01s)
        img_hash_test.go:39: contrib.PHash: 4b4bb5b593dbdc5c
        img_hash_test.go:49: contrib.PHash: similarity 32
    --- PASS: TestHashes/AverageHash (0.01s)
        img_hash_test.go:39: contrib.AverageHash: fe2e003e083fff38
        img_hash_test.go:49: contrib.AverageHash: similarity 32
    --- PASS: TestHashes/BlockMeanHash (0.01s)
        img_hash_test.go:39: contrib.BlockMeanHash: fefffefffc19040c000c0004f80ffc0ffe0f00000078ffffffff0100f00f000c
        img_hash_test.go:49: contrib.BlockMeanHash: similarity 117
    --- PASS: TestHashes/ColorMomentHash (0.05s)
        img_hash_test.go:39: contrib.ColorMomentHash: e2bc48734e41713fb4030a51122b983ed513553c0090143e4baa76cff311213e51a9e05868044c3c9ec5d7f3f98b743dd006907c6f071e3cea2c8acae669663f1ccfffe7403f633e6dc398dd69dcc63d6b9daf73bf2cd23dc67d905a4357a5bb9c400997ec600abdd43796bbefd5a8bbf07670a89f0a543f2e65899058384e3efce737526dc0a03d64332a7aa747533d8bdd13fe16a0deba55b0d80a477b7fbc001ab0740f98363a2a543df6fd82553f0d4ab986ced74f3e607a960faaf8983d0e1fc67d665a513d88ed51ec0c32c73ad4cb6dc756986d3c945fbaebd85ed3baf8aa586157b5543ff21744b8f58b013e5c12f5ce78e6413dd21a5c2a30e95f3d6e6080a7b2a7b23ae307cacc6a9167bccdafcf2f8c12bcbaea1f824a3d7d563f345a6adcd5e1083e83c009ce7050543dd0530d87a9c9633d47362907812bca3a056fe992121c713c18751a9d2857c7ba
        img_hash_test.go:49: contrib.ColorMomentHash: similarity 42.20263981441593
    --- PASS: TestHashes/MarrHidlrethHash (0.05s)
        img_hash_test.go:39: contrib.MarrHildrethHash: f036d93b66cc91b749f0125b7b42dc91b76cda125b7a4e4c9097689a125b72424c9093499b16cb72424c9092499b742062424c9092499306cb7371b36c920f9336c92b9db490965b
        img_hash_test.go:49: contrib.MarrHildrethHash: similarity 256
    --- PASS: TestHashes/RadialVarianceHash (0.01s)
        img_hash_test.go:39: contrib.RadialVarianceHash: 4a00ff448f574e652b6039573f4e4349414a4f474c48494e50484e4f474b4b494b45464748484a49
        img_hash_test.go:49: contrib.RadialVarianceHash: similarity 0.49646512207080945
=== RUN   TestSingleTrackers
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
X server found. dri2 connection failed! 
--- PASS: TestSingleTrackers (3.25s)
=== RUN   TestSIFT
--- PASS: TestSIFT (0.47s)
=== RUN   TestSURF
--- PASS: TestSURF (0.80s)
PASS
ok      gocv.io/x/gocv/contrib  5.352s

Your Environment

$ go run cmd/version/main.go 
gocv version: 0.21.0
opencv lib version: 4.0.1
[mh-cbon@Host-001 gocv] $ go version && go env
go version go1.12.7 linux/amd64
GOARCH="amd64"
GOBIN="/home/mh-cbon/gow/bin"
GOCACHE="/home/mh-cbon/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mh-cbon/gow"
GOPROXY=""
GORACE=""
GOROOT="/home/mh-cbon/.gvm/gos/go1.12.7"
GOTMPDIR=""
GOTOOLDIR="/home/mh-cbon/.gvm/gos/go1.12.7/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build576078236=/tmp/go-build -gno-record-gcc-switches"
[mh-cbon@Host-001 gocv] $ lsb_release -a && uname -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 31 (Thirty One)
Release:    31
Codename:   ThirtyOne
Linux Host-001 5.3.14-300.fc31.x86_64 #1 SMP Mon Dec 2 15:41:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
set -e
set -x

OPENCV_VERSION="4.0.1"

mkdir -p installation/opencv-"$OPENCV_VERSION"

cwd=$(pwd)

sudo dnf -y install \
  git gcc gcc-c++ cmake3 \
  qt5-qtbase-devel gtk2-devel \
  ffmpeg ffmpeg-devel \
  libpng-devel openexr-devel \
  libwebp-devel libjpeg-turbo-devel \
  freeglut-devel mesa-libGL mesa-libGL-devel \
  libtiff-devel

sudo dnf -y install \
  libdc1394-devel --skip-broken

sudo dnf -y install \
  tbb-devel eigen3-devel \
  boost boost-thread boost-devel

curl -Lo opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip
unzip -q opencv.zip
curl -Lo opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip
unzip -q opencv_contrib.zip
rm opencv.zip opencv_contrib.zip
cd opencv-${OPENCV_VERSION}

rm -fr build
mkdir -p build

cd build
cmake3 \
  -D CMAKE_BUILD_TYPE=RELEASE \
  -D CMAKE_INSTALL_PREFIX=$cwd/installation/opencv-"$OPENCV_VERSION" \
  -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-$OPENCV_VERSION/modules \
  -D OPENCV_ENABLE_NONFREE=ON \
  -D WITH_JASPER=OFF \
  -D BUILD_DOCS=OFF \
  -D BUILD_EXAMPLES=OFF \
  -D BUILD_TESTS=OFF \
  -D BUILD_PERF_TESTS=OFF \
  -D BUILD_opencv_java=NO \
  -D BUILD_opencv_python=NO \
  -D BUILD_opencv_python2=NO \
  -D BUILD_opencv_python3=NO \
  -D ENABLE_CXX11=ON \
  -D WITH_OPENGL=ON \
  -D WITH_QT=ON \
  -D WITH_TBB=ON \
  -D WITH_V4L=ON \
  -D OPENCV_GENERATE_PKGCONFIG=ON ..

make -j $(nproc --all)
make preinstall
make install
# ldconfig
# make -j$(nproc)
# make install

cd $cwd
mh-cbon commented 4 years ago

i m not sure this is solvable, this looks like it is an opencv issue (unclear as there is no such ticket https://github.com/opencv/opencv/issues?utf8=%E2%9C%93&q=is%3Aissue+wayland), not gocv. Maybe an env variable could be defined to exclude some tests (all stuff around windows) for systems that are not supported ?

deadprogram commented 4 years ago

We could do that with build tags and moving those tests into a separate file.

That said, I'm not sure what is or is not supported in Wayland as I do not have a test environment setup for it. So, not sure how to proceed on this one.

rafaelmeneses commented 4 years ago

I had the same problem. The addSlider2 function of modules/highgui/src/window_QT.cpp of opencv need a parameter, named "value", to be not null.

void GuiReceiver::addSlider2(QString bar_name, QString window_name, void* value, int count, void* on_change, void *userdata)
{
    QBoxLayout *layout = NULL;
    QPointer<CvWindow> w;

    if (!window_name.isEmpty())
    {
        w = icvFindWindowByName(window_name);

        if (!w)
            return;
    }
    else
    {
        if (global_control_panel)
            layout = global_control_panel->myLayout;
    }

    QPointer<CvTrackbar> t = icvFindTrackBarByName(bar_name.toLatin1().data(), window_name.toLatin1().data(), layout);

    if (t) //trackbar exists
        return;

    if (!value)
        CV_Error(CV_StsNullPtr, "NULL value pointer" );

    if (count <= 0) //count is the max value of the slider, so must be bigger than 0
        CV_Error(CV_StsNullPtr, "Max value of the slider must be bigger than 0" );

    CvWindow::addSlider2(w, bar_name, (int*)value, count, (CvTrackbarCallback2) on_change, userdata);
}

I fixed the problem setting a value to that parameter. My awful solution was modifying highgui.cpp of gocv:

int cero=0;
void Trackbar_Create(const char* winname, const char* trackname, int max) {
    cv::createTrackbar(trackname, winname,  &cero, max);
}

functioned but it is a horrible solution ;)

rafaelmeneses commented 3 years ago

Hi, In my workspace, I changed this file: ./src/gocv.io/x/gocv/highgui.cpp After that, I compiled with "go build", and it worked.

El mié., 23 sept. 2020 a las 10:24, Patrick Hener (notifications@github.com) escribió:

@rafaelmeneses https://github.com/rafaelmeneses What am I supposed to do after changing it in my module pkg path at go/pkg/mod/ gocv.io/x/gocv@v0.24.0/highgui.cpp. The error still persists.

-- Rafael Meneses ____ Zambeca ®, 2019 | www.zambeca.cl