if (area >= 30 &&
std::abs(1 - ((double)rect.width / (double)rect.height)) <= 0.2 &&
std::abs(1 - (area / (CV_PI * std::pow(radius, 2)))) <= 0.2)
我想要翻译的是std::abs
和CV_PI * std::pow
。
我在网上搜索等同于java的std::abs
并且找不到任何内容。请帮忙。无法搜索CV_PI * std::pow
,因为我仍然无法找到std::abs
。
答案 0 :(得分:7)
查看Math
班。
https://docs.oracle.com/javase/7/docs/api/java/lang/Math.html
Math.PI
Math.pow(...)
Math.abs(...)
etc.