// 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. Leetcode: Range Sum Query 2D - Mutable && Summary: Binary Indexed Tree

    Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper lef ...

  2. Leetcode: String to Integer

    Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. ...

  3. UVA 10891 Game of Sum(DP)

    This is a two player game. Initially there are n integer numbers in an array and players A and B get ...

  4. 17---Net基础加强

    更新中,敬请期待............ 复习 将xml显示到treeview 修改增加 删除 foreach原理 深拷贝与浅拷贝 模拟数据库及登陆 复习总结

  5. js break continue

    for 循环从 1 到 10 迭代变量 i.在循环主体中,if 语句将(使用取模运算符)检查 i 的值是否能被 5 整除.如果能被 5 整除,将执行 break 语句.alert 显示 "4 ...

  6. jquery遍历对象,数组,集合

    1.jquery 遍历对象 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTM ...

  7. full_case & parallel_case

    case中的full_case与parallel_case讨论: 1)术语介绍: 整个case模块叫做:case_statement,注释部分叫做case_statement_header case ...

  8. 《zw版·delphi与halcon系列原创教程》zw版_THOperatorSetX控件函数列表 v11中文增强版

    <zw版·delphi与halcon系列原创教程>zw版_THOperatorSetX控件函数列表v11中文增强版 Halcon虽然庞大,光HALCONXLib_TLB.pas文件,源码就 ...

  9. 雅虎工程师提供的CSS初始化代码

    body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,b ...

  10. 使用JWPlayer在网页中嵌入视频

    首发:个人博客,持续更新和纠错 我一直以为在网页中嵌入视频是件复杂的事,一研究才知道原来非常简单. 实际就是在页面中嵌入个控件.社区里已有很多解决方案了.jwplayer是最受欢迎的(之一).控件包括 ...