﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>农业大数据 &#8211; 学术创新中心</title>
	<atom:link href="https://www.leexinghai.com/aic/category/zafu/zaful2/agri_big_data/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.leexinghai.com/aic</link>
	<description>Academic Innovation Center</description>
	<lastBuildDate>Mon, 13 Apr 2026 05:01:39 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.leexinghai.com/aic/wp-content/uploads/2025/08/cropped-徽标名称-32x32.jpg</url>
	<title>农业大数据 &#8211; 学术创新中心</title>
	<link>https://www.leexinghai.com/aic</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>H60430-0413-图像数据预处理之图像均衡化</title>
		<link>https://www.leexinghai.com/aic/h60430-0413-%e5%9b%be%e5%83%8f%e6%95%b0%e6%8d%ae%e9%a2%84%e5%a4%84%e7%90%86%e4%b9%8b%e5%9b%be%e5%83%8f%e5%9d%87%e8%a1%a1%e5%8c%96/</link>
		
		<dc:creator><![CDATA[李星海]]></dc:creator>
		<pubDate>Mon, 13 Apr 2026 05:01:37 +0000</pubDate>
				<category><![CDATA[农业大数据]]></category>
		<guid isPermaLink="false">https://www.leexinghai.com/aic/?p=4484</guid>

					<description><![CDATA[完成直方图均衡化 已知： 一、先写出原始归一化直方图 你已经给出了：pr(rk)=nkMNp_r(r_k)=\ [&#8230;]]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="579" src="https://www.leexinghai.com/aic/wp-content/uploads/2026/04/image-1024x579.png" alt="" class="wp-image-4485" srcset="https://www.leexinghai.com/aic/wp-content/uploads/2026/04/image-1024x579.png 1024w, https://www.leexinghai.com/aic/wp-content/uploads/2026/04/image-300x170.png 300w, https://www.leexinghai.com/aic/wp-content/uploads/2026/04/image-768x434.png 768w, https://www.leexinghai.com/aic/wp-content/uploads/2026/04/image-1536x869.png 1536w, https://www.leexinghai.com/aic/wp-content/uploads/2026/04/image.png 1671w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>完成直方图均衡化</p>



<p>已知：</p>



<ul class="wp-block-list">
<li>图像大小：<math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>64</mn><mo>×</mo><mn>64</mn></mrow><annotation encoding="application/x-tex">64\times 64</annotation></semantics></math></li>



<li>总像素数： <math data-latex="MN=64×64=4096"><semantics><mrow><mi>M</mi><mi>N</mi><mo>=</mo><mn>64</mn><mo>×</mo><mn>64</mn><mo>=</mo><mn>4096</mn></mrow><annotation encoding="application/x-tex">MN=64×64=4096</annotation></semantics></math></li>



<li>灰度级数：3比特，所以 <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>L</mi><mo>=</mo><msup><mn>2</mn><mn>3</mn></msup><mo>=</mo><mn>8</mn></mrow><annotation encoding="application/x-tex">L = 2^3 = 8</annotation></semantics></math>灰度级为：<math data-latex="0,1,2,3,4,5,6,7"><semantics><mn>0,1,2,3,4,5,6,7</mn><annotation encoding="application/x-tex">0,1,2,3,4,5,6,7</annotation></semantics></math></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">一、先写出原始归一化直方图</h1>



<p>你已经给出了：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>p</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msub><mi>r</mi><mi>k</mi></msub><mo stretchy="false">)</mo><mo>=</mo><mfrac><msub><mi>n</mi><mi>k</mi></msub><mrow><mi>M</mi><mi>N</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">p_r(r_k)=\frac{n_k}{MN}</annotation></semantics></math></p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">r_k</annotation></semantics></math></th><th><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>n</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">n_k</annotation></semantics></math></th><th><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>p</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msub><mi>r</mi><mi>k</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">p_r(r_k)</annotation></semantics></math></th></tr></thead><tbody><tr><td>0</td><td>790</td><td>0.19</td></tr><tr><td>1</td><td>1023</td><td>0.25</td></tr><tr><td>2</td><td>850</td><td>0.21</td></tr><tr><td>3</td><td>656</td><td>0.16</td></tr><tr><td>4</td><td>329</td><td>0.08</td></tr><tr><td>5</td><td>245</td><td>0.06</td></tr><tr><td>6</td><td>122</td><td>0.03</td></tr><tr><td>7</td><td>81</td><td>0.02</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">二、求累计分布函数 CDF</h1>



<p>直方图均衡化的核心就是先求累计概率：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>s</mi><mi>k</mi></msub><mo>=</mo><mi>T</mi><mo stretchy="false">(</mo><msub><mi>r</mi><mi>k</mi></msub><mo stretchy="false">)</mo><mo>=</mo><mo stretchy="false">(</mo><mi>L</mi><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></munderover><msub><mi>p</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msub><mi>r</mi><mi>j</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">s_k = T(r_k) = (L-1)\sum_{j=0}^{k} p_r(r_j)</annotation></semantics></math></p>



<p>因为这里 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mo>=</mo><mn>8</mn></mrow><annotation encoding="application/x-tex">L=8</annotation></semantics></math>L=8，所以：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>L</mi><mo>−</mo><mn>1</mn><mo>=</mo><mn>7</mn></mrow><annotation encoding="application/x-tex">L-1=7</annotation></semantics></math></p>



<p>先算累计概率：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">r_k</annotation></semantics></math></th><th><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>p</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msub><mi>r</mi><mi>k</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">p_r(r_k)</annotation></semantics></math></th><th>累计概率 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></msubsup><msub><mi>p</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msub><mi>r</mi><mi>j</mi></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\sum_{j=0}^{k} p_r(r_j)</annotation></semantics></math></th></tr></thead><tbody><tr><td>0</td><td>0.19</td><td>0.19</td></tr><tr><td>1</td><td>0.25</td><td>0.44</td></tr><tr><td>2</td><td>0.21</td><td>0.65</td></tr><tr><td>3</td><td>0.16</td><td>0.81</td></tr><tr><td>4</td><td>0.08</td><td>0.89</td></tr><tr><td>5</td><td>0.06</td><td>0.95</td></tr><tr><td>6</td><td>0.03</td><td>0.98</td></tr><tr><td>7</td><td>0.02</td><td>1.00</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">三、代入均衡化变换公式</h1>



<p>计算：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>s</mi><mi>k</mi></msub><mo>=</mo><mn>7</mn><mo>×</mo><mtext>CDF</mtext></mrow><annotation encoding="application/x-tex">s_k = 7 \times \text{CDF}</annotation></semantics></math></p>



<p>得到：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">r_k</annotation></semantics></math></th><th>CDF</th><th><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>7</mn><mo>×</mo><mtext>CDF</mtext></mrow><annotation encoding="application/x-tex">7\times \text{CDF}</annotation></semantics></math></th></tr></thead><tbody><tr><td>0</td><td>0.19</td><td>1.33</td></tr><tr><td>1</td><td>0.44</td><td>3.08</td></tr><tr><td>2</td><td>0.65</td><td>4.55</td></tr><tr><td>3</td><td>0.81</td><td>5.67</td></tr><tr><td>4</td><td>0.89</td><td>6.23</td></tr><tr><td>5</td><td>0.95</td><td>6.65</td></tr><tr><td>6</td><td>0.98</td><td>6.86</td></tr><tr><td>7</td><td>1.00</td><td>7.00</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">四、把新灰度级量化为整数</h1>



<p>因为输出仍然是3比特图像，所以新灰度也只能取：<math data-latex="0,1,2,3,4,5,6,7"><semantics><mn>0,1,2,3,4,5,6,7</mn><annotation encoding="application/x-tex">0,1,2,3,4,5,6,7</annotation></semantics></math></p>



<p>通常教材里会采用<strong>四舍五入</strong>：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>s</mi><mi>k</mi></msub><mo>=</mo><mtext>round</mtext><mo stretchy="false">(</mo><mn>7</mn><mo>×</mo><mtext>CDF</mtext><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">s_k = \text{round}(7\times \text{CDF})</annotation></semantics></math></p>



<p>于是得到映射关系：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>原灰度 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">r_k</annotation></semantics></math></th><th><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>7</mn><mo>×</mo><mtext>CDF</mtext></mrow><annotation encoding="application/x-tex">7\times \text{CDF}</annotation></semantics></math></th><th>新灰度 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>s</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">s_k</annotation></semantics></math></th></tr></thead><tbody><tr><td>0</td><td>1.33</td><td>1</td></tr><tr><td>1</td><td>3.08</td><td>3</td></tr><tr><td>2</td><td>4.55</td><td>5</td></tr><tr><td>3</td><td>5.67</td><td>6</td></tr><tr><td>4</td><td>6.23</td><td>6</td></tr><tr><td>5</td><td>6.65</td><td>7</td></tr><tr><td>6</td><td>6.86</td><td>7</td></tr><tr><td>7</td><td>7.00</td><td>7</td></tr></tbody></table></figure>



<p>所以<strong>均衡化映射函数</strong>为：<math data-latex="0→1,1→3,2→5,3→6,4→6,5→7,6→7,7→7"><semantics><mrow><mn>0</mn><mo stretchy="false">→</mo><mn>1,1</mn><mo stretchy="false">→</mo><mn>3,2</mn><mo stretchy="false">→</mo><mn>5,3</mn><mo stretchy="false">→</mo><mn>6,4</mn><mo stretchy="false">→</mo><mn>6,5</mn><mo stretchy="false">→</mo><mn>7,6</mn><mo stretchy="false">→</mo><mn>7,7</mn><mo stretchy="false">→</mo><mn>7</mn></mrow><annotation encoding="application/x-tex">0→1,1→3,2→5,3→6,4→6,5→7,6→7,7→7</annotation></semantics></math></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">五、得到均衡化后的直方图</h1>



<p>现在把原来每个灰度级的像素数，按照新映射加到对应的新灰度级上。</p>



<h2 class="wp-block-heading">映射汇总</h2>



<ul class="wp-block-list">
<li>原来灰度 0 的 790 个像素 → 新灰度 1</li>



<li>原来灰度 1 的 1023 个像素 → 新灰度 3</li>



<li>原来灰度 2 的 850 个像素 → 新灰度 5</li>



<li>原来灰度 3 的 656 个像素 → 新灰度 6</li>



<li>原来灰度 4 的 329 个像素 → 新灰度 6</li>



<li>原来灰度 5 的 245 个像素 → 新灰度 7</li>



<li>原来灰度 6 的 122 个像素 → 新灰度 7</li>



<li>原来灰度 7 的 81 个像素 → 新灰度 7</li>
</ul>



<p>于是均衡化后的像素数为：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>新灰度级</th><th>像素数</th></tr></thead><tbody><tr><td>0</td><td>0</td></tr><tr><td>1</td><td>790</td></tr><tr><td>2</td><td>0</td></tr><tr><td>3</td><td>1023</td></tr><tr><td>4</td><td>0</td></tr><tr><td>5</td><td>850</td></tr><tr><td>6</td><td>656+329=985</td></tr><tr><td>7</td><td>245+122+81=448</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">六、写出均衡化后的归一化直方图</h1>



<p>再除以总像素数 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4096</mn></mrow><annotation encoding="application/x-tex">4096</annotation></semantics></math>：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>新灰度级</th><th>像素数</th><th>概率</th></tr></thead><tbody><tr><td>0</td><td>0</td><td>0.0000</td></tr><tr><td>1</td><td>790</td><td>0.1929</td></tr><tr><td>2</td><td>0</td><td>0.0000</td></tr><tr><td>3</td><td>1023</td><td>0.2498</td></tr><tr><td>4</td><td>0</td><td>0.0000</td></tr><tr><td>5</td><td>850</td><td>0.2075</td></tr><tr><td>6</td><td>985</td><td>0.2405</td></tr><tr><td>7</td><td>448</td><td>0.1094</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">七、最后结果怎么写</h1>



<p>如果你要把答案完整写成作业格式，可以直接写成下面这样：</p>



<h2 class="wp-block-heading">1. 均衡化变换函数</h2>



<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>s</mi><mi>k</mi></msub><mo>=</mo><mtext>round</mtext><mrow><mo fence="true">[</mo><mo stretchy="false">(</mo><mi>L</mi><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></munderover><msub><mi>p</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msub><mi>r</mi><mi>j</mi></msub><mo stretchy="false">)</mo><mo fence="true">]</mo></mrow><mo>=</mo><mtext>round</mtext><mrow><mo fence="true">[</mo><mn>7</mn><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></munderover><msub><mi>p</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msub><mi>r</mi><mi>j</mi></msub><mo stretchy="false">)</mo><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">s_k = \text{round}\left[(L-1)\sum_{j=0}^{k} p_r(r_j)\right] = \text{round}\left[7\sum_{j=0}^{k} p_r(r_j)\right]</annotation></semantics></math></p>



<h2 class="wp-block-heading">2. CDF计算结果</h2>



<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">[</mo><mn>0.19</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.44</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.65</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.81</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.89</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.95</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.98</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>1.00</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">[0.19,\ 0.44,\ 0.65,\ 0.81,\ 0.89,\ 0.95,\ 0.98,\ 1.00]</annotation></semantics></math></p>



<h2 class="wp-block-heading">3. 灰度映射关系</h2>



<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mn>0</mn><mo>→</mo><mn>1</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>1</mn><mo>→</mo><mn>3</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>2</mn><mo>→</mo><mn>5</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>3</mn><mo>→</mo><mn>6</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>4</mn><mo>→</mo><mn>6</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>5</mn><mo>→</mo><mn>7</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>6</mn><mo>→</mo><mn>7</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>7</mn><mo>→</mo><mn>7</mn></mrow><annotation encoding="application/x-tex">0\to1,\ 1\to3,\ 2\to5,\ 3\to6,\ 4\to6,\ 5\to7,\ 6\to7,\ 7\to7</annotation></semantics></math></p>



<h2 class="wp-block-heading">4. 均衡化后直方图</h2>



<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">[</mo><mn>0</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>790</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>1023</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>850</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>985</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>448</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">[0,\ 790,\ 0,\ 1023,\ 0,\ 850,\ 985,\ 448]</annotation></semantics></math></p>



<h2 class="wp-block-heading">5. 均衡化后归一化直方图</h2>



<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">[</mo><mn>0</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.1929</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.2498</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.2075</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.2405</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>0.1094</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">[0,\ 0.1929,\ 0,\ 0.2498,\ 0,\ 0.2075,\ 0.2405,\ 0.1094]</annotation></semantics></math></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">八、为什么均衡化后不一定“完全平坦”？</h1>



<p>这是很多人第一次学时会疑惑的点。</p>



<p>原因是：</p>



<ul class="wp-block-list">
<li>图像灰度级只有 <strong>8级</strong></li>



<li>像素数是离散的</li>



<li>映射后多个原灰度可能会落到同一个新灰度级</li>
</ul>



<p>所以均衡化后的直方图通常只是<strong>比原来更均匀</strong>，而不是绝对每级都一样高。</p>



<p>这很正常，不是你算错了。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">九、补充：有些教材会用“向下取整”</h1>



<p>有的书会写成：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>s</mi><mi>k</mi></msub><mo>=</mo><mrow><mo fence="true">⌊</mo><mn>7</mn><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></munderover><msub><mi>p</mi><mi>r</mi></msub><mo stretchy="false">(</mo><msub><mi>r</mi><mi>j</mi></msub><mo stretchy="false">)</mo><mo fence="true">⌋</mo></mrow></mrow><annotation encoding="application/x-tex">s_k = \left\lfloor 7 \sum_{j=0}^{k} p_r(r_j) \right\rfloor</annotation></semantics></math></p>



<p>如果用向下取整，结果会稍有不同。<br>但大多数课堂题、作业题更常见的是<strong>四舍五入</strong>。你交作业前最好看看老师课件上的定义是哪一种。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h1 class="wp-block-heading">十、这道题最简答案版</h1>



<p>你考试时如果时间紧，可以直接写：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mtext>CDF</mtext><mo>=</mo><mo stretchy="false">[</mo><mn>0.19</mn><mo separator="true">,</mo><mn>0.44</mn><mo separator="true">,</mo><mn>0.65</mn><mo separator="true">,</mo><mn>0.81</mn><mo separator="true">,</mo><mn>0.89</mn><mo separator="true">,</mo><mn>0.95</mn><mo separator="true">,</mo><mn>0.98</mn><mo separator="true">,</mo><mn>1.00</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">\text{CDF}=[0.19,0.44,0.65,0.81,0.89,0.95,0.98,1.00]</annotation></semantics></math><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>s</mi><mi>k</mi></msub><mo>=</mo><mtext>round</mtext><mo stretchy="false">(</mo><mn>7</mn><mo>⋅</mo><mtext>CDF</mtext><mo stretchy="false">)</mo><mo>=</mo><mo stretchy="false">[</mo><mn>1</mn><mo separator="true">,</mo><mn>3</mn><mo separator="true">,</mo><mn>5</mn><mo separator="true">,</mo><mn>6</mn><mo separator="true">,</mo><mn>6</mn><mo separator="true">,</mo><mn>7</mn><mo separator="true">,</mo><mn>7</mn><mo separator="true">,</mo><mn>7</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">s_k=\text{round}(7\cdot \text{CDF})=[1,3,5,6,6,7,7,7]</annotation></semantics></math></p>



<p>所以映射关系为：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mn>0</mn><mo>→</mo><mn>1</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>1</mn><mo>→</mo><mn>3</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>2</mn><mo>→</mo><mn>5</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>3</mn><mo>→</mo><mn>6</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>4</mn><mo>→</mo><mn>6</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>5</mn><mo>→</mo><mn>7</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>6</mn><mo>→</mo><mn>7</mn><mo separator="true">,</mo><mtext>&nbsp;</mtext><mn>7</mn><mo>→</mo><mn>7</mn></mrow><annotation encoding="application/x-tex">0\to1,\ 1\to3,\ 2\to5,\ 3\to6,\ 4\to6,\ 5\to7,\ 6\to7,\ 7\to7</annotation></semantics></math></p>



<p>均衡化后各灰度级像素数为：<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>n</mi><mi>s</mi></msub><mo>=</mo><mo stretchy="false">[</mo><mn>0</mn><mo separator="true">,</mo><mn>790</mn><mo separator="true">,</mo><mn>0</mn><mo separator="true">,</mo><mn>1023</mn><mo separator="true">,</mo><mn>0</mn><mo separator="true">,</mo><mn>850</mn><mo separator="true">,</mo><mn>985</mn><mo separator="true">,</mo><mn>448</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">n_s=[0,790,0,1023,0,850,985,448]</annotation></semantics></math></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
