dynamicCast<Boost> returns Segmentation fault
Hi,
I'm using OpenCV 3.3 running on Linux and bumped into following error:
Ptr create_model()
{
Ptr model = Boost::create();
model->setBoostType(Boost::DISCRETE);
}
int main()
{
Ptr model = create_model().dynamicCast<Boost>()
}
I've used dynamicCast successfully with other classes (SVM, trees, logistic regression), however, casting to boost returns Segmentation fault. Backtracking is not very helpful either:
#0 0x0000ffffb6c625d4 in __dynamic_cast () from /usr/lib/libstdc++.so.6
#1 0x00000000004066e8 in cv::Ptr<cv::ml::Boost> cv::Ptr<cv::ml::StatModel>::dynamicCast<cv::ml::Boost>() const ()
Is it a bug? Or bad compilation?
Many thanks!
can you try again with editing, and show your real code ? there seem to things missing (template arguments) !
also please explain why you need a dynamicCast here at all.
again, above code does not compile, and imho, if you need any cast here, you're doing something (horribly) wrong.