software is hard this is a good blog about firefox relevent information

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
将下面代码写成matlab形式 int runBm3d( const Mat image_noisy, Mat& image_basic, Mat& image_denoised ) { int Height = image_noisy.rows; int Width = image_noisy.cols; int Channels = image_noisy.channels(); vector<Mat> block_noisy;//store the patch vector<int>row_idx;//patch idx along the row direction vector<int>col_idx; GetAllBlock(image_noisy, Width, Height, Channels, kHard, pHard, block_noisy, row_idx, col_idx); int bn_r = row_idx.size(); int bn_c = col_idx.size(); tran2d(block_noisy, kHard); vector<int> sim_num;//index number for the selected similar patch in the block vector vector<int> sim_idx_row;//index number for the selected similar patch in the original Mat vector<int> sim_idx_col; vector<Mat>data;//store the data during transforming and shrinking Mat kaiser = gen_kaiser(beta, kHard);//2-D kaiser window float weight_hd = 1.0;//weights used for current relevent patch Mat denominator_hd(image_noisy.size(), CV_32FC1, Scalar::all(0)); Mat numerator_hd(image_noisy.size(), CV_32FC1, Scalar::all(0)); for (int i = 0; i < bn_r; i++) { for (int j = 0; j < bn_c; j++) { //for each pack in the block sim_num.clear(); sim_idx_row.clear(); sim_idx_col.clear(); data.clear(); getSimilarPatch(block_noisy, data, sim_num, i, j, bn_r, bn_c, int((nHard - kHard) / pHard) + 1, NHard, tao_hard);//block matching for (int k = 0; k < sim_num.size(); k++)//calculate idx in the left-top corner { sim_idx_row.push_back(row_idx[sim_num[k] / bn_c]); sim_idx_col.push_back(col_idx[sim_num[k] % bn_c]); } tran1d(data, kHard);//3-D transforming DetectZero(data, lambda3d * sigma);//shrink the cofficient weight_hd = calculate_weight_hd(data, sigma); Inver3Dtrans(data,kHard);//3-D inverse transforming aggregation(numerator_hd, denominator_hd, sim_idx_row, sim_idx_col, data, weight_hd, kHard, kaiser);//aggregation using weigths } } image_basic = numerator_hd / denominator_hd;
05-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值