// Multiply 正片叠底
void Multiply(Mat& src1, Mat& src2, Mat& dst)
{
    for(int index_row=0; index_row<src1.rows; index_row++)
    {
        for(int index_col=0; index_col<src1.cols; index_col++)
        {
            for(int index_c=0; index_c<3; index_c++)
                dst.at<Vec3f>(index_row, index_col)[index_c]=
                src1.at<Vec3f>(index_row, index_col)[index_c]*
                src2.at<Vec3f>(index_row, index_col)[index_c];
        }
    }
}
// Color_Burn 颜色加深
void Color_Burn(Mat& src1, Mat& src2, Mat& dst)
{
    for(int index_row=0; index_row<src1.rows; index_row++)
    {
        for(int index_col=0; index_col<src1.cols; index_col++)
        {
            for(int index_c=0; index_c<3; index_c++)
                dst.at<Vec3f>(index_row, index_col)[index_c]=1-
                (1-src1.at<Vec3f>(index_row, index_col)[index_c])/
                src2.at<Vec3f>(index_row, index_col)[index_c];
        }
    }
}
// 线性增强
void Linear_Burn(Mat& src1, Mat& src2, Mat& dst)
{
    for(int index_row=0; index_row<src1.rows; index_row++)
    {
        for(int index_col=0; index_col<src1.cols; index_col++)
        {
            for(int index_c=0; index_c<3; index_c++)
                dst.at<Vec3f>(index_row, index_col)[index_c]=max(
                src1.at<Vec3f>(index_row, index_col)[index_c]+
                src2.at<Vec3f>(index_row, index_col)[index_c]-1, (float)0.0);
        }
    }

}

模拟ps中的图像叠加操作,实现同样的效果

【20160924】GOCVHelper 图像增强部分(5)的更多相关文章

  1. 【20160924】GOCVHelper 图像增强部分(4)

    //使得rect区域半透明     Mat translucence(Mat src,Rect rect,int idepth){         Mat dst = src.clone();     ...

  2. 【20160924】GOCVHelper 图像增强部分(1)

    图像增强是图像处理的第一步.这里集成了一些实际使用过程中有用的函数.   //读取灰度或彩色图片到灰度     Mat imread2gray(string path){         Mat sr ...

  3. 【20160924】GOCVHelper 图像增强部分(3)

    //顶帽去光差,radius为模板半径     Mat moveLightDiff(Mat src,int radius){         Mat dst;         Mat srcclone ...

  4. 【20160924】GOCVHelper 图像增强部分(2)

       //填充孔洞     //fillholes     Mat fillHoles(Mat src){         Mat dst = getInnerHoles(src);          ...

  5. 基于Opencv和Mfc的图像处理增强库GOCVHelper(索引)

    GOCVHelper(GreenOpen Computer Version Helper )是我在这几年编写图像处理程序的过程中积累下来的函数库.主要是对Opencv的适当扩展和在实现Mfc程序时候的 ...

  6. 【20160924】GOCVHelper综述

    GOCVHelper(GreenOpen Computer Version Helper )是我在这几年编写图像处理程序的过程中积累下来的函数库.主要是对Opencv的适当扩展和在实现Mfc程序时候的 ...

  7. 【20160924】GOCVHelper MFC增强算法(4)

    //string替换     void string_replace(string & strBig, const string & strsrc, const string & ...

  8. 【20160924】GOCVHelper 图像处理部分(3)

    //根据轮廓的圆的特性进行选择     vector<VP> selectShapeCircularity(Mat src,Mat& draw,vector<VP> c ...

  9. 【20160924】GOCVHelper 图像处理部分(2)

    //根据轮廓的面积大小进行选择     vector<VP>  selectShapeArea(Mat src,Mat& draw,vector<VP> contour ...

随机推荐

  1. A*啦啦啦

    ...A*是个啥都不知道.. 大家注意K短路可能不存在!!!! 果然是s==t的问题……加个if(s==t) k++就A了…… 单用Dij,tle到死 原来是单向k短路........开始以为是双向的 ...

  2. UVa 10088 - Trees on My Island (pick定理)

    样例: 输入:123 16 39 28 49 69 98 96 55 84 43 51 3121000 10002000 10004000 20006000 10008000 30008000 800 ...

  3. php类与对象简单操作

    <?php /* * Created on 2015-8-25 * * To change the template for this generated file go to * Window ...

  4. paper 22:kl-divergence(KL散度)实现代码

    这个函数很重要: function KL = kldiv(varValue,pVect1,pVect2,varargin) %KLDIV Kullback-Leibler or Jensen-Shan ...

  5. 夺命雷公狗—angularjs—8—ng-class的简单用法

    我们在正常的业务处理中往往会遇到一些逻辑类的问题,比如各行换色,现在angularjs里面也给我们提供了一个小小的的class处理的方式,废话不多说,如下所示: <!doctype html&g ...

  6. 【sinatra】结合Padrino framework

    用Sinatra来做复杂的Web应用时,会出现若干个比较麻烦的点. 要手工作成一个个的应用骨架.作成test .view.public目录等等 将Sinatra DSL集中在一个类中的话,画面数量增加 ...

  7. andriod之应用内置浏览器 webview

    参考:http://my.eoe.cn/694183/archive/10476.html http://blog.csdn.net/it_ladeng/article/details/8136534 ...

  8. Hadoop之TaskInputOutputContext类

    在MapReduce过程中,每一个Job都会被分成若干个task,然后再进行处理.那么Hadoop是怎么将Job分成若干个task,并对其进行跟踪处理的呢?今天我们来看一个*Context类——Tas ...

  9. 在Asp.Net的Global.asax中Application_Error跳转到自定义错误页无效的解决办法

    在开发Asp.Net系统的时候,我们很多时候希望系统发生错误后能够跳转到一个自定义的错误页面,于是我们经常会在Global.asax中的Application_Error方法中使用Response.R ...

  10. 如何查看和停止Linux启动的服务

    1. 查看Linux启动的服务chkconfig --list 查询出所有当前运行的服务chkconfig --list atd  查询atd服务的当前状态 2.停止所有服务并且在下次系统启动时不再启 ...