How to edit this method to draw polygon using javacv?

做~自己de王妃 提交于 2019-12-03 20:50:15

The first thing you need to do is reduce the problem domain down to a simple repeatable case. Identify which polygon shapes are leading to the crash. You could have a look at the C/C++ source code for opencv to see what checks it does not carry out, for example does it allow off-screen pixels?

You could go further and write a wrapper class that performs a series of checks and logs each function call, allowing you to know exactly when the error takes place, whether the error happens in the same place every time and also the sequence of events that led to the error.

Alternatively you could test the points passed to drawPoly by temporarily having drawPoly call drawSquare, first sending points 0-3, and then points 4-7, just to validate the fact that the points sent are not triggering the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!