// 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: Perfect Rectangle

    Given N axis-aligned rectangles where N > 0, determine if they all together form an exact cover o ...

  2. html 字体加粗

    <font style="font-weight: bold;">无敌小昆虫</font> <font>无敌小昆虫</font> f ...

  3. UISearchController的使用

    - (void)addSearchController { _searchController = [[UISearchController alloc] initWithSearchResultsC ...

  4. .NET: WPF DependencyProperty

    DependencyProperty and DependencyObject is the core of WPF data binding. We can use this two class t ...

  5. Cookie—的使用

    编写 Cookie 浏览器负责管理用户系统上的 Cookie.Cookie 通过 HttpResponse 对象发送到浏览器,该对象公开称为 Cookies 的集合. 可以将 HttpResponse ...

  6. JSon_零基础_004_将Set集合对象转换为JSon格式的对象字符串,返回给界面

    将Set集合对象转换为JSon格式的对象字符串,返回给界面 需要导入的jar包: 编写:servlet: package com.west.webcourse.servlet; import java ...

  7. struts自定义拦截器

    第01步:配置web.xml,启动struts框架 <?xml version="1.0" encoding="UTF-8"?> <web-a ...

  8. Spark K-Means

    K-Means(K均值) 介绍 K-Means是被应用的最广泛的基于划分的聚类算法,是一种硬聚类算法,属于典型的局域原型的目标函数聚类的代表.算法首先随机选择k个对象,每个对象初始地代表一个簇的平均值 ...

  9. mysql server安装及密码重置

    官网上能下载到的mysql安装分两种:msi和zip安装 msi安装比较简单,直接下一步. 主要说zip格式的安装: 1.解压. zip解压后的文件夹改名后(也可以不改名)放在喜欢的位置.例如我放在C ...

  10. java 虚拟机工具

    jps 命令 可以查询开启了rmi服务的远程虚拟机进程状态. -v jvm参数. jstat -gcutil命令 [cangyue@/System/Library/Frameworks/JavaVM. ...