Skip to content

Commit 837e04c

Browse files
Update README.md
1 parent 71a5b5d commit 837e04c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

番外篇07. 亮度与对比度/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
亮度调整是将图像像素的强度整体变大/变小,对比度调整指的是图像暗处的像素强度变低,亮出的变高,从而拓宽某个区域内的显示精度。
1212

13-
OpenCV中亮度和对比度应用这个公式来计算:$ g(x)=\alpha f(x)+\beta $,其中:α(>0)、β常称为增益与偏置值,分别控制图片的对比度和亮度。
13+
OpenCV中亮度和对比度应用这个公式来计算:
14+
15+
<span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mi>g</mi><mo stretchy=&quot;false&quot;>(</mo><mi>x</mi><mo stretchy=&quot;false&quot;>)</mo><mo>=</mo><mi>&amp;#x03B1;</mi><mi>f</mi><mo stretchy=&quot;false&quot;>(</mo><mi>x</mi><mo stretchy=&quot;false&quot;>)</mo><mo>+</mo><mi>&amp;#x03B2;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1" style="width: 9.003em; display: inline-block;"><span style="display: inline-block; position: relative; width: 7.503em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.336em, 1007.5em, 2.669em, -999.997em); top: -2.219em; left: 0em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: MathJax_Math-italic;">g<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-4" style="font-family: MathJax_Main;">(</span><span class="mi" id="MathJax-Span-5" style="font-family: MathJax_Math-italic;">x</span><span class="mo" id="MathJax-Span-6" style="font-family: MathJax_Main;">)</span><span class="mo" id="MathJax-Span-7" style="font-family: MathJax_Main; padding-left: 0.281em;">=</span><span class="mi" id="MathJax-Span-8" style="font-family: MathJax_Math-italic; padding-left: 0.281em;">α</span><span class="mi" id="MathJax-Span-9" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.058em;"></span></span><span class="mo" id="MathJax-Span-10" style="font-family: MathJax_Main;">(</span><span class="mi" id="MathJax-Span-11" style="font-family: MathJax_Math-italic;">x</span><span class="mo" id="MathJax-Span-12" style="font-family: MathJax_Main;">)</span><span class="mo" id="MathJax-Span-13" style="font-family: MathJax_Main; padding-left: 0.225em;">+</span><span class="mi" id="MathJax-Span-14" style="font-family: MathJax_Math-italic; padding-left: 0.225em;">β<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.225em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.33em; border-left: 0px solid; width: 0px; height: 1.337em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>g</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>=</mo><mi>α</mi><mi>f</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo>+</mo><mi>β</mi></math></span></span>
16+
17+
,其中:α(>0)、β常称为增益与偏置值,分别控制图片的对比度和亮度。
1418

1519
> 经验之谈:此处对α/β控制对比度和亮度有争议,具体请参考:[OpenCV关于对比度和亮度的误解](http://blog.csdn.net/abc20002929/article/details/40474807)
1620
@@ -43,4 +47,4 @@ cv2.waitKey(0)
4347
- [numpy.clip()](https://docs.scipy.org/doc/numpy/reference/generated/numpy.clip.html#numpy.clip)
4448
- [OpenCV关于对比度和亮度的误解](http://blog.csdn.net/abc20002929/article/details/40474807)
4549
- [OpenCV改变图像亮度和对比度以及优化](http://blog.csdn.net/u013139259/article/details/52145377)
46-
- [Mat::convertTo](https://docs.opencv.org/3.1.0/d3/d63/classcv_1_1Mat.html#a3f356665bb0ca452e7d7723ccac9a810)
50+
- [Mat::convertTo](https://docs.opencv.org/3.1.0/d3/d63/classcv_1_1Mat.html#a3f356665bb0ca452e7d7723ccac9a810)

0 commit comments

Comments
 (0)