OpenCV Error: Assertion failed (tlsSlots.size() > slotIdx) in releaseSlot

asked 2020-02-27 02:25:57 -0500

ziknehupsu gravatar image

Hello everyone ;

I can ask a little question.

My code ;

#include <iostream>
#include "opencv2/opencv.hpp"
#include <opencv2/core/cuda.hpp>

using namespace cv;
int main()
{
//cv::cuda::GpuMat h1;
Mat h;
h = imread("s.png");
if (h.empty())
{
    std::cout << "!!! Failed imread(): image not found" << std::endl;
}

return 0;
}

This is err;

OpenCV Error: Assertion failed (tlsSlots.size() > slotIdx) in releaseSlot, file /build/opencv-XDqSFW/opencv-3.2.0+dfsg/modules/core/src/system.cpp, line 1092
terminate called after throwing an instance of 'cv::Exception'
  what():  /build/opencv-XDqSFW/opencv-3.2.0+dfsg/modules/core/src/system.cpp:1092: error: (-215) tlsSlots.size() > slotIdx in function releaseSlot

Aborted (core dumped)
edit retag flag offensive close merge delete

Comments

/opencv-3.2.0+dfsg

outdated, also looks like something prebuilt from some ppm, it won't have any cuda support

please build 3.4.9 or resp. master + contrib from src, cuda sdk

berak gravatar imageberak ( 2020-02-27 02:53:12 -0500 )edit

I have a warn ;

/usr/bin/ld: warning: libopencv_core.so.4.2, needed by /usr/local/lib/libopencv_imgcodecs.so.4.2.0, may conflict with libopencv_core.so.3.2

My CMakeList;

set(OpenCV_DIR /usr/local/lib/cmake/opencv4)
find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  message_filters
  roscpp
  rospy
  sensor_msgs
  std_msgs
  OpenCV
)

How can I fix it ?

ziknehupsu gravatar imageziknehupsu ( 2020-02-27 03:54:31 -0500 )edit
1

please uninstall opencv3.2, or, at least, stick with a single opencv version.

then, noone can help with ros problems here....

berak gravatar imageberak ( 2020-02-27 04:32:01 -0500 )edit