Langchain-Chatchat
Langchain-Chatchat copied to clipboard
读取带图片的pdf文件传给服务报错
用java应用读取带图片的pdf文件传给项目,报错 报错内容如下: 加载文档时出错:OpenCV(4.9.0) /io/opencv/modules/imgproc/src/imgwarp.cpp:3547: error: (-215:Assertion failed) src.checkVector(2, CV_32F) == 4 && dst.checkVector(2, CV_32F) == 4 in function 'getPerspectiveTransform'\n"}
🤖
嘿,@wkw1542673895!又见面了,遇到新挑战了吗?期待一起解决问题!
您的问题看起来与OpenCV库中的getPerspectiveTransform函数有关。这个错误通常发生在传递给getPerspectiveTransform函数的源点和目标点不符合预期格式(一个包含4个元素的2D点向量)时。
在您提供的上下文中,我找到了一个类似的已解决问题:知识库添加PDF文件到向量库时不成功,后台提示OpenCV Assertion failed错误。这个问题的解决方案是将M = cv2.getPerspectiveTransform(points, pts_std)修改为M = cv2.getPerspectiveTransform(points.astype("float32"), pts_std)。
请检查您的代码中使用getPerspectiveTransform的部分,确保传递给它的源点和目标点符合正确的格式。如果问题仍然存在,麻烦您提供相关的代码以便我们能提供进一步的帮助。
另外,关于OpenCV库在Langchain-Chatchat项目中的具体功能,我没有在仓库中找到答案,可能需要在其他地方寻找,或者我可能遗漏了一些信息。
Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
这个很正常,是ocr的bug,分辨率问题,目前没有很好的解决办法,这张图片是没办法被扫描的
这个很正常,是ocr的bug,分辨率问题,目前没有很好的解决办法,这张图片是没办法被扫描的
我用strealit框架传同样的文件是可以的,但是通过java来传就报错
@wkw1542673895 参考这个中描述的修改看是否能解决:https://github.com/chatchat-space/Langchain-Chatchat/issues/2530
@wkw1542673895 参考这个中描述的修改看是否能解决:#2530
非常感谢,可以用哈