yuanlu
December 17, 2022, 11:38am
1
I am using SDK v3.8.2 on Windows11
I’m making my own recognizer according to this tutorial
But I found that sl::CustomBoxObjectData
seems to have some exceptions:
bounding_box_2d [capacity]
has an incorrect value, so that an error occurs when it is released.
I don’t know whether this is caused by the Windows platform, but this problem is inevitable, so it can’t be carried out at all.
int main() {
sl::CustomBoxObjectData tmp;
}
Just such simple code will also throw an exception at the end of the method.
SL-PY
December 22, 2022, 4:27pm
2
Hi,
what is the output of this code?
int main() {
sl::CustomBoxObjectData tmp;
if (tmp.bounding_box_2d.size() != 4)
std::cout << "wrong size " << tmp.bounding_box_2d.size() << "\n";
return 0;
}
the default constructor should init the size of the bounding_box_2d to 4.
yuanlu
December 22, 2022, 4:50pm
3
int main() {
sl::CustomBoxObjectData tmp;
std::cout << "size(): " << tmp.bounding_box_2d.size() << std::endl;
std::cout << "capacity(): " << tmp.bounding_box_2d.capacity() << std::endl;
return 0;
}
D:\yuanlu\dev\cpp\ifr\zed-test\cmake-build-debug\zed_test.exe
size(): 0
capacity(): 18446743830405820717
exit code: -1073740791 (0xC0000409)
SL-PY
December 22, 2022, 5:06pm
4
It looks like you are in debug,
in this case the std::vector might not behave as expected, change to Release or RelWithDebInfo.
yuanlu
December 22, 2022, 5:12pm
5
oh After I changed to Release, it ran successfully!
Thank you!
D:\yuanlu\dev\cpp\ifr\zed-test\cmake-build-release\zed_test.exe
size(): 4
capacity(): 4