在qt creator中,一段代码无法编译与运行到

在我的一段代码中,如下的else分支无法调试也无法编译运行到。
else {
        //qDebug() << "#### crop d x " << depth_color.cols << " d y " << depth_color.rows << " r x " << rgb_x << " r y" << rgb_y;
        //640 * 400 或者 320* 200 与 rgb 640 * 480的对齐会走到这个分支
 
        /*步骤1:将深度图按照rate的比例放大*/
        Size dsize(depth_x * rate, depth_y * rate);
        cv::resize(depth_color, depth_color, dsize);
        cv::resize(depth_clone, depth_clone, dsize);
 
        /*将640*400的depth copy到640*480 的rgb,并且将depth_color 与decodeRgb规整为一样大*/
        Rect rect(0, 0, depth_x * rate, depth_y * rate);
        cv::Mat depth_color_new(rgb_y, rgb_x, CV_8UC3, Scalar(0, 0, 0));
        cv::Mat depth_clone_new(rgb_y, rgb_x, CV_16UC1, Scalar(0));
        depth_color.copyTo(depth_color_new);
        depth_clone.copyTo(depth_clone_new);
        depth_color = depth_color_new.clone();
        depth_clone = depth_clone_new.clone();
    }

将上面代码修改为如下代码后:

else {
        //qDebug() << "#### crop d x " << depth_color.cols << " d y " << depth_color.rows << " r x " << rgb_x << " r y" << rgb_y;
        //640 * 400 或者 320* 200 与 rgb 640 * 480的对齐会走到这个分支
 
        //步骤1:将深度图按照rate的比例放大 --------------------将注释语句从/**/修改为//
        Size dsize(depth_x * rate, depth_y * rate);
        cv::resize(depth_color, depth_color, dsize);
        cv::resize(depth_clone, depth_clone, dsize);
 
        //将640*400的depth copy到640*480 的rgb,并且将depth_color 与decodeRgb规整为一样大将注释语句从/**/修改为//
        Rect rect(0, 0, depth_x * rate, depth_y * rate);
        cv::Mat depth_color_new(rgb_y, rgb_x, CV_8UC3, Scalar(0, 0, 0));
        cv::Mat depth_clone_new(rgb_y, rgb_x, CV_16UC1, Scalar(0));
        depth_color.copyTo(depth_color_new);
        depth_clone.copyTo(depth_clone_new);
        depth_color = depth_color_new.clone();
        depth_clone = depth_clone_new.clone();
    }
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值