OpenCV(4.0.1) C:\ci\opencv-suite_1573470242804\work\modules\core\src\matmul.cpp:1218: error: (-215:Assertion failed) type == CV_64FC2 in function 'cv::gemmImpl'
时间: 2023-07-21 19:52:36 浏览: 258
这个错误提示是因为你传递给 OpenCV 的矩阵类型不匹配。具体来说,你的代码中使用的矩阵类型应该是 CV_64FC2,但是你传递给 OpenCV 的矩阵类型不是这个。你需要检查一下你的代码,看看是不是有地方出现了类型错乱的问题。另外,你也可以尝试使用 cv::Mat::convertTo() 方法将矩阵类型转换为所需的类型,以解决这个问题。
相关问题
Traceback (most recent call last): File "C:\Users\DELL\Desktop\dataTool\test.py", line 38, in <module> transformed_coordinate = cv2.perspectiveTransform(pixel_coordinate, perspective_matrix) cv2.error: OpenCV(4.6.0) C:\b\abs_74oeeuevib\croots\recipe\opencv-suite_1664548340488\work\modules\core\src\matmul.dispatch.cpp:550: error: (-215:Assertion failed) scn + 1 == m.cols in function 'cv::perspectiveTransform' Traceback (most recent call last): File "C:\Users\DELL\Desktop\dataTool\test.py", line 38, in <module> transformed_coordinate = cv2.perspectiveTransform(pixel_coordinate, perspective_matrix) cv2.error: OpenCV(4.6.0) C:\b\abs_74oeeuevib\croots\recipe\opencv-suite_1664548340488\work\modules\core\src\matmul.dispatch.cpp:550: error: (-215:Assertion failed) scn + 1 == m.cols in function 'cv::perspectiveTransform' Traceback (most recent call last): File "C:\Users\DELL\Desktop\dataTool\test.py", line 38, in <module> transformed_coordinate = cv2.perspectiveTransform(pixel_coordinate, perspective_matrix) cv2.error: OpenCV(4.6.0) C:\b\abs_74oeeuevib\croots\recipe\opencv-suite_1664548340488\work\modules\core\src\matmul.dispatch.cpp:550: error: (-215:Assertion failed) scn + 1 == m.cols in function 'cv::perspectiveTransform' Traceback (most recent call last): File "C:\Users\DELL\Desktop\dataTool\test.py", line 38, in <module> transformed_coordinate = cv2.perspectiveTransform(pixel_coordinate, perspective_matrix) cv2.error: OpenCV(4.6.0) C:\b\abs_74oeeuevib\croots\recipe\opencv-suite_1664548340488\work\modules\core\src\matmul.dispatch.cpp:550: error: (-215:Assertion failed) scn + 1 == m.cols in function 'cv::perspectiveTransform' Traceback (most recent call last): File "C:\Users\DELL\Desktop\dataTool\test.py", line 38, in <module> transformed_coordinate = cv2.perspectiveTransform(pixel_coordinate, perspective_matrix)
这个错误通常出现在透视变换的输入参数上。请确保输入的像素坐标和透视变换矩阵的维度和类型是正确的。以下是一些可能导致错误的原因和解决方法:
1. 检查像素坐标的维度和类型是否正确。像素坐标应该是一个形状为 (N, 1, 2) 的浮点数数组,其中 N 是点的数量。
2. 检查透视变换矩阵的维度和类型是否正确。透视变换矩阵应该是一个形状为 (3, 3) 的浮点数数组。
3. 检查像素坐标和透视变换矩阵的数据类型是否匹配。通常情况下,像素坐标和透视变换矩阵都应该是浮点数类型(`float32`)。
4. 确保你的像素坐标和透视变换矩阵是正确对应的。透视变换矩阵是通过使用 `cv2.findHomography` 函数计算得到的,它需要一组对应的像素坐标和地理坐标。
如果你仍然遇到问题,请提供更多的代码和错误信息,以便我可以更好地帮助你解决问题。
OpenCV(4.8.1) C:\GHA-OCV-2\_work\ci-gha-workflow\ci-gha-workflow\opencv\modules\highgui\src\window.cpp:449: error: (-215:Assertion failed)
OpenCV(Open Source Computer Vision Library)是一个开源的计算机视觉库,它提供了丰富的图像处理和计算机视觉算法。它可以用于处理图像和视频数据,包括图像的读取、显示、保存,以及各种图像处理操作,如滤波、边缘检测、特征提取等。
关于你提到的错误信息:C:\GHA-OCV-2\_work\ci-gha-workflow\ci-gha-workflow\opencv\modules\highgui\src\window.cpp:449: error: (-215:Assertion failed)。这个错误通常是由于断言失败引起的,可能是由于输入参数不符合预期或者程序逻辑错误导致的。具体的解决方法需要查看代码和错误信息的上下文。
阅读全文
相关推荐
![whl](https://img-home.csdnimg.cn/images/20250102104920.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)