dengyueyun666 / image-contrast-enhancement Goto Github PK
View Code? Open in Web Editor NEWC++ implementation of several image contrast enhancement techniques.
License: MIT License
C++ implementation of several image contrast enhancement techniques.
License: MIT License
感觉挺不错的总结
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 ?
Image-Contrast-Enhancement/src/SEF.cpp
Line 160 in cd2b1eb
This would be amazing to incorporate the EEF version into OpenCV as it addresses some Mertens Merge shortcomings.
which armadillo version should be work? I found no 'spdiags' function in armadillo-10.1.2
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)
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.