Closed Eragonlrc closed 5 months ago
As far as I know, (-215:Assertion failed) s >= 0 in function 'setSize'
happens when the Mat
is empty, which is often caused by incorrect image path. Have you checked whether all the cv::Mat
have proper content?
Thanks for replying! However, I insert
imwrite("./image_level" + to_string(level) + ".jpg", image);
before
Mat temp(wholeSize, image.type()), masktemp;
to check the content of cv::Mat image
in function ORBextractor::ComputePyramid()
As a result, it saves a correct 640*480 gray image. So I'm sure that the function has a correct input.
And wholeSize.width=678
, wholeSize.height=518
The problem confuses me most is that when I replaced the usage of Size
variables, the exception dissappeared, while it's impossible to replace every usage of Size
variables.
Solved by preparing the environment by docker.
The problem confuses me most is that when I replaced the usage of
Size
variables, the exception dissappeared, while it's impossible to replace every usage ofSize
variables.
It may conflict with the built-in system opencv
in ORB-SLAM3
.
After building the project on Ubuntu 22.04LTS with the same versions of the dependencies as mentioned in README, I'm trying to run the examples/tum_mono.cpp with args:
but got error report bellow:
Exception occurred in function:
When trying to call
cv::Mat
orcv::resize()
with parameters includingSize
type, exceptions about assertion failure occurred. For example, I replacewith
the exception disappeared when
level=0
, but this exception occurred whenlevel=1
:However, when I replace
main()
function withit run and resized an image successfully. So I think OpenCV environment has nothing to do with the problem.
Then why the exception occurred?