Tagged: 

Viewing 0 reply threads
  • Author
    Posts
    • #17580 Score: 0
      Reloof
      Participant

      用下面代码获得纹理的颜色

      
      if (payload.texture)
      {
          // TODO: Get the texture value at the texture coordinates of the current fragment
          return_color = payload.texture->getColor(payload.tex_coords.x(), payload.tex_coords.y());
      }
      

      但opencv会报错:
      OpenCV(4.6.0) Error: Assertion failed ((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels())) in cv::Mat::at, file C:\opencv\build\include\opencv2\core\mat.inl.hpp, line 899
      OpenCV: terminate handler is called! The last OpenCV error is:
      OpenCV(4.6.0) Error: Assertion failed ((unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels())) in cv::Mat::at, file C:\opencv\build\include\opencv2\core\mat.inl.hpp, line 899
      感觉像是下标超界

Viewing 0 reply threads
  • You must be logged in to reply to this topic.