imgwarp-opencv
imgwarp-opencv copied to clipboard
Divide by zero
Hello.
First for all, thanks for sharing great code.
I have found some memory crashing case.
When i put the same zero control point , some code makes crashing.
// 2 zero points
qsrc.push_back(cv::Point_<int>(0, 0));
qsrc.push_back(cv::Point_<int>(0, 0));
// 2 zero points
qdst.push_back(cv::Point_<int>(0, 0));
qdst.push_back(cv::Point_<int>(0, 0));
In imgwarp_mls_rigid.cpp
tmpP *= w[k] / miu_r;
Above code makes dividing by zero without handling.
It seems to happen when i put control points which have the same values.
Thanks for debugging! Please feel free to send a PR. Thanks!
Fogrunner @.***>于2022年9月27日 周二上午12:40写道:
It seems to happen when i put control points in the same location.
— Reply to this email directly, view it on GitHub https://github.com/cxcxcxcx/imgwarp-opencv/issues/11#issuecomment-1259110037, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABZUDEAHQT3SDQ2MJ5COHLWAKQF5ANCNFSM6AAAAAAQWPD7TA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
-- Sent from Gmail Mobile