Coder Social home page Coder Social logo

dengyueyun666 / image-contrast-enhancement Goto Github PK

View Code? Open in Web Editor NEW
210.0 6.0 66.0 323 KB

C++ implementation of several image contrast enhancement techniques.

License: MIT License

CMake 1.29% C++ 98.71%
image-enhancement image-contrast-enhancement image-processing

image-contrast-enhancement's Introduction

Image-Contrast-Enhancement

C++ implementation of several image contrast enhancement techniques.

Techniques

Requirements

  • Ubuntu-16.04
  • Cmake
  • OpenCV-3.4.6+
  • Dlib-19.18+
  • SuperLU-5.2.1+
  • Armadillo-9.800.3+
    • Before install Armadillo, SuperLU 5 must be installed.

Usage

cd Image-Contrast-Enhancement
cmake .
make
./main <input_image>

Citations

@article{tao2005adaptive,
  title={Adaptive and integrated neighborhood-dependent approach for nonlinear enhancement of color images},
  author={Tao, Li and Asari, Vijayan K},
  journal={Journal of Electronic Imaging},
  volume={14},
  number={4},
  pages={043006},
  year={2005},
  publisher={International Society for Optics and Photonics}
}

@article{wang2007fast,
  title={Fast image/video contrast enhancement based on weighted thresholded histogram equalization},
  author={Wang, Qing and Ward, Rabab K},
  journal={IEEE transactions on Consumer Electronics},
  volume={53},
  number={2},
  pages={757--764},
  year={2007},
  publisher={IEEE}
}

@article{arici2009histogram,
  title={A histogram modification framework and its application for image contrast enhancement},
  author={Arici, Tarik and Dikbas, Salih and Altunbasak, Yucel},
  journal={IEEE Transactions on image processing},
  volume={18},
  number={9},
  pages={1921--1935},
  year={2009},
  publisher={IEEE}
}

@article{lee2013contrast,
  title={Contrast enhancement based on layered difference representation of 2D histograms},
  author={Lee, Chulwoo and Lee, Chul and Kim, Chang-Su},
  journal={IEEE transactions on image processing},
  volume={22},
  number={12},
  pages={5372--5384},
  year={2013},
  publisher={IEEE}
}

@article{huang2013efficient,
  title={Efficient Contrast Enhancement Using Adaptive Gamma Correction With Weighting Distribution},
  author={Huang, Shihchia and Cheng, Fanchieh and Chiu, Yisheng},
  journal={IEEE Transactions on Image Processing},
  volume={22},
  number={3},
  pages={1032--1041},
  year={2013}
}

@article{rahman2016an,
  title={An adaptive gamma correction for image enhancement},
  author={Rahman, Shanto and Rahman, Mostafijur and Abdullahalwadud, M and Alquaderi, Golam Dastegir and Shoyaib, Mohammad},
  journal={Eurasip Journal on Image and Video Processing},
  volume={2016},
  number={1},
  pages={35},
  year={2016}
}

@article{cao2017contrast,
  title={Contrast enhancement of brightness-distorted images by improved adaptive gamma correction},
  author={Cao, Gang and Huang, Lihui and Tian, Huawei and Huang, Xianglin and Wang, Yongbin and Zhi, Ruicong},
  journal={Computers & Electrical Engineering},
  volume={66},
  pages={569--582},
  year={2017}
}

@inproceedings{ying2017new,
  title={A New Image Contrast Enhancement Algorithm Using Exposure Fusion Framework},
  author={Ying, Zhenqiang and Li, Ge and Ren, Yurui and Wang, Ronggang and Wang, Wenmin},
  booktitle={International Conference on Computer Analysis of Images and Patterns},
  pages={36--46},
  year={2017},
  organization={Springer}
}

@article{fu2018retinex,
  title={Retinex-based perceptual contrast enhancement in images using luminance adaptation},
  author={Fu, Qingtao and Jung, Cheolkon and Xu, Kaiqiang},
  journal={IEEE Access},
  volume={6},
  pages={61277--61286},
  year={2018},
  publisher={IEEE}
}

@article{wang2019adaptive,
  title={Adaptive image enhancement method for correcting low-illumination images},
  author={Wang, Wencheng and Chen, Zhenxue and Yuan, Xiaohui and Wu, Xiaojin},
  journal={Information Sciences},
  volume={496},
  pages={25--41},
  year={2019},
  publisher={Elsevier}
}

@article{agrawal2019novel,
  title={A novel joint histogram equalization based image contrast enhancement},
  author={Agrawal, Sanjay and Panda, Rutuparna and Mishro, PK and Abraham, Ajith},
  journal={Journal of King Saud University-Computer and Information Sciences},
  year={2019},
  publisher={Elsevier}
}

@inproceedings{hessel2020extended,
  title={An extended exposure fusion and its application to single image contrast enhancement},
  author={Hessel, Charles and Morel, Jean-Michel},
  booktitle={The IEEE Winter Conference on Applications of Computer Vision},
  pages={137--146},
  year={2020}
}

License

Copyright © 2022 dengyueyun666

This project is under the MIT License. See the LICENSE file for the full license text.

image-contrast-enhancement's People

Contributors

dengyueyun666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

image-contrast-enhancement's Issues

Does SEF also work for multiple images?

Hi,

awesome repository - I'm actually trying to port the https://github.com/chlsl/extended-exposure-fusion-ipol implementation to OpenCV and just found your implementation of the single file variant. Do you think it's doable to make your version accept one or more (bracketed) images ?

void SEF(const cv::Mat & src, cv::Mat & dst, double alpha, double beta, double lambda)

This would be amazing to incorporate the EEF version into OpenCV as it addresses some Mertens Merge shortcomings.

Licensing of this repo

Hi,

Could you specify which license this repo is under?

I would like to compare some of my own image enhancement work against other algorithms and your library is a convenient repo for this. My work would fall under commercial use, although I would only use your code for image comparisons - I would not modify/expand on your code.

armadillo version

which armadillo version should be work? I found no 'spdiags' function in armadillo-10.1.2

python implementation do not work

opencv-python==3.4.2.17
numpy==1.19.1

function output image is black image

def CELA(img):
HSV = cv2.cvtColor(img, cv2.COLOR_BGR2HSV_FULL)
HSV_channels = cv2.split(HSV)
V = HSV_channels[2]

ksize = 5
gauker1 = cv2.getGaussianKernel(ksize, 15)
gauker2 = cv2.getGaussianKernel(ksize, 80)
gauker3 = cv2.getGaussianKernel(ksize, 250)

gauV1 = cv2.filter2D(V, cv2.CV_8U, gauker1, anchor=(-1, -1), delta=0, borderType=cv2.BORDER_CONSTANT)
gauV2 = cv2.filter2D(V, cv2.CV_8U, gauker2, anchor=(-1, -1), delta=0, borderType=cv2.BORDER_CONSTANT)
gauV3 = cv2.filter2D(V, cv2.CV_8U, gauker3, anchor=(-1, -1), delta=0, borderType=cv2.BORDER_CONSTANT)

lut = np.zeros(256, np.uint8)
for i in range(256):
    lut[i] = 17.0 * (1. - math.sqrt(i/127.)) + 3. if i <= 127 else 3. / 128. *(i - 127.) + 3.
    lut[i] = (-lut[i] + 20.)/17.

beta1 = cv2.LUT(gauV1, lut)
beta2 = cv2.LUT(gauV2, lut)
beta3 = cv2.LUT(gauV3, lut)

gauV1 = np.float64(gauV1/255.)
gauV2 = np.float64(gauV2/255.)
gauV3 = np.float64(gauV3/255.)
V = np.float64(V/255.)

V = cv2.log(V)
gauV1 = cv2.log(gauV1)
gauV2 = cv2.log(gauV2)
gauV3 = cv2.log(gauV3)

r = (3. * V - beta1 * gauV1 - beta2 * gauV2 - beta3 * gauV3) / 3.0

R = cv2.exp(r)
R_min, R_max = np.min(R), np.max(R)
V_w = (R - R_min)/ (R_max - R_min)
V_w = np.uint8(V_w*255)

histsize = 256
hist = cv2.calcHist([V_w], [0], None, [histsize], [0, 255], accumulate=False)

pdf = hist / img.size
pdf_min, pdf_max = np.min(pdf), np.max(pdf)
for i in range(histsize):
    pdf[i] = pdf_max * (pdf[i] - pdf_min) / (pdf_max - pdf_min)
    
cdf = [0] * 256
accum = 0
for i in range(255):
    accum += pdf[i]
    cdf[i] = accum
cdf[255] = 1. - accum

V_w_max = np.max(V_w)
for i in range(255):
    lut[i] = V_w_max * math.pow((i *1./V_w_max), 1. - cdf[i])

V_out = cv2.LUT(V_w, lut)
V_out = np.uint8(V_out)

HSV_channels[2] = V_out
HSV = cv2.merge(HSV_channels)
return cv2.cvtColor(HSV, cv2.COLOR_HSV2BGR_FULL)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.