opencv-cvRound返回整数值-四舍五入

#include<opencv2/opencv.hpp>
#include<iostream>
#include  <vector>


int main(int argc, char** argv) {

    std::cout << "cvRound(3.7) = " << cvRound(3.7) << std::endl;
    std::cout << "cvRound(3.2) = " << cvRound(3.2) << std::endl;
    std::cout << "cvRound(-3.7) = " << cvRound(-3.7) << std::endl;
    std::cout << "cvRound(-3.2) = " << cvRound(-3.2) << std::endl;
    //返回四舍五入后的整数值
    


    cv::waitKey(0);
    return 0;
}

 

 

 

 

posted @ 2022-01-15 08:59  天子骄龙  阅读(184)  评论(0编辑  收藏  举报