zoukankan      html  css  js  c++  java
  • 【20160924】GOCVHelper 图像增强部分(5)

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

    }

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





  • 相关阅读:
    Median Value
    237. Delete Node in a Linked List
    206. Reverse Linked List
    160. Intersection of Two Linked Lists
    83. Remove Duplicates from Sorted List
    21. Merge Two Sorted Lists
    477. Total Hamming Distance
    421. Maximum XOR of Two Numbers in an Array
    397. Integer Replacement
    318. Maximum Product of Word Lengths
  • 原文地址:https://www.cnblogs.com/jsxyhelu/p/5907547.html
Copyright © 2011-2022 走看看