tag:blogger.com,1999:blog-15894446298606880972024-02-21T12:47:49.649+05:30 Digital Image Processing prem888http://www.blogger.com/profile/06697980223859507647noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-1589444629860688097.post-59020372023942013772013-11-17T14:59:00.001+05:302016-01-19T10:54:11.389+05:30Difference between SNR and PSNR<div dir="ltr" style="text-align: left;" trbidi="on">
<table><tbody>
<tr><td class="votecell"><span style="font-family: inherit;"><br /></span></td><td class="votecell"><span style="font-family: inherit;"><br /></span></td>
<td class="answercell"><div class="post-text">
<span style="font-family: inherit;">In Image processing, we often use Signal to Noise Ratio (SNR) and Peak Signal to Noise Ratio (PSNR) for quality measurement.</span><br />
<span style="font-family: inherit;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
</span><br />
<table><tbody>
<tr><td class="votecell"></td>
<td class="postcell"><div>
<span style="font-family: inherit;">I understood that SNR is the ratio of signal power to the
noise power. In terms of images, it shows how the original image is affected by
the added noise. In PSNR, we take the square of the peak value in the
image (in case of an 8 bit image, the peak value is 255) and divide it
by the mean square error. The SNR and PSNR are used to measure the
quality of an image after the reconstruction. I understand that higher
the SNR or PSNR, the reconstruction is good. What I don't
understand is how SNR and PSNR differs in terms of their conclusion
about the reconstructed image. What the PSNR of an image concludes that
the SNR of the same image can't conclude ? Simply how the conclusion of
PSNR differs from the conclusion of SNR? These are the questions I had when tried to completely understand what is this SNR and PSNR. If you too have the same questions, read further to get clarified.</span></div>
<div>
</div>
<div>
<span style="font-family: inherit;"><br /></span></div>
</td></tr>
</tbody></table>
<span style="font-family: inherit;">Let's start with the mathematical definitions.</span><br />
<span style="font-family: inherit;">Discrete signal power is defined as
<span class="MathJax_Preview"></span></span><br />
<div class="MathJax_Display" role="textbox" style="text-align: center;">
<span class="MathJax" id="MathJax-Element-1-Frame"><nobr><span class="math" id="MathJax-Span-1" style="display: inline-block; font-family: inherit; width: 12.446em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 10.357em;"><span style="clip: rect(1.116em, 1000em, 4.193em, -0.503em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-2"><span class="msubsup" id="MathJax-Span-3"><span style="display: inline-block; height: 0px; position: relative; width: 1.097em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-4" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.231em;"><span class="mi" id="MathJax-Span-5" style="font-size: 70.7%; font-style: italic;">s</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-6" style="padding-left: 0.278em;">=</span><span class="munderover" id="MathJax-Span-7" style="padding-left: 0.278em;"><span style="display: inline-block; height: 0px; position: relative; width: 1.429em;"><span style="clip: rect(2.74em, 1000em, 4.498em, -0.481em); left: 0em; position: absolute; top: -3.869em;"><span class="mo" id="MathJax-Span-8" style="vertical-align: 0em;">∑</span><span style="display: inline-block; height: 3.869em; width: 0px;"></span></span><span style="clip: rect(1.89em, 1000em, 2.667em, -0.476em); left: 0.089em; position: absolute; top: -1.331em;"><span class="texatom" id="MathJax-Span-9"><span class="mrow" id="MathJax-Span-10"><span class="mo" id="MathJax-Span-11" style="font-size: 70.7%;">−</span><span class="mi" id="MathJax-Span-12" style="font-size: 70.7%;">∞</span></span></span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span><span style="clip: rect(1.79em, 1000em, 2.567em, -0.497em); left: 0.357em; position: absolute; top: -3.531em;"><span class="texatom" id="MathJax-Span-13"><span class="mrow" id="MathJax-Span-14"><span class="mi" id="MathJax-Span-15" style="font-size: 70.7%;">∞</span></span></span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="msubsup" id="MathJax-Span-16" style="padding-left: 0.167em;"><span style="display: inline-block; height: 0px; position: relative; width: 0.908em;"><span style="clip: rect(1.998em, 1000em, 2.808em, -0.483em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-17" style="font-style: italic;">s</span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.476em; position: absolute; top: -2.794em;"><span class="mn" id="MathJax-Span-18" style="font-size: 70.7%;">2</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-19">[</span><span class="mi" id="MathJax-Span-20" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-21">]</span><span class="mo" id="MathJax-Span-22" style="padding-left: 0.278em;">=</span><span class="msubsup" id="MathJax-Span-23" style="padding-left: 0.278em;"><span style="display: inline-block; height: 0px; position: relative; width: 2.635em;"><span style="clip: rect(1.929em, 1000em, 3.286em, -0.417em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-24"><span class="mo" id="MathJax-Span-25" style="vertical-align: 0em;">|</span><span class="mi" id="MathJax-Span-26" style="font-style: italic;">s</span><span class="mo" id="MathJax-Span-27">[</span><span class="mi" id="MathJax-Span-28" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-29">]</span><span class="mo" id="MathJax-Span-30" style="vertical-align: 0em;">|</span><span style="border-left: 0em solid; display: inline-block; height: 0.75em; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="border-left: 0em solid; display: inline-block; height: 0.75em; overflow: hidden; vertical-align: 0em; width: 0px;"></span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span><span style="left: 2.202em; position: absolute; top: -2.858em;"><span class="mn" id="MathJax-Span-31" style="font-size: 70.7%;">2</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-32">.</span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 3.407em; overflow: hidden; vertical-align: -1.461em; width: 0px;"></span></span></nobr></span></div>
<span style="font-family: inherit;">We can apply this notion to noise <span class="MathJax_Preview"></span><span class="MathJax" id="MathJax-Element-2-Frame" role="textbox"><nobr><span class="math" id="MathJax-Span-33" style="display: inline-block; width: 0.875em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 0.714em;"><span style="clip: rect(1.997em, 1000em, 2.809em, -0.515em); left: 0em; position: absolute; top: -2.619em;"><span class="mrow" id="MathJax-Span-34"><span class="mi" id="MathJax-Span-35" style="font-style: italic;">w</span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 0.688em; overflow: hidden; vertical-align: -0.085em; width: 0px;"></span></span></nobr></span> on top of some signal to calculate <span class="MathJax_Preview"></span><span class="MathJax" id="MathJax-Element-3-Frame" role="textbox"><nobr><span class="math" id="MathJax-Span-36" style="display: inline-block; width: 1.518em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 1.25em;"><span style="clip: rect(1.4em, 1000em, 2.598em, -0.503em); left: 0em; position: absolute; top: -2.262em;"><span class="mrow" id="MathJax-Span-37"><span class="msubsup" id="MathJax-Span-38"><span style="display: inline-block; height: 0px; position: relative; width: 1.276em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-39" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.231em;"><span class="mi" id="MathJax-Span-40" style="font-size: 70.7%; font-style: italic;">w</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span></span><span style="display: inline-block; height: 2.262em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 1.152em; overflow: hidden; vertical-align: -0.261em; width: 0px;"></span></span></nobr></span> in the same way. The signal to noise ratio (SNR) is then simply
<span class="MathJax_Preview"></span></span><br />
<div class="MathJax_Display" role="textbox" style="text-align: center;">
<span class="MathJax" id="MathJax-Element-4-Frame"><nobr><span class="math" id="MathJax-Span-41" style="display: inline-block; font-family: inherit; width: 6.375em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 5.298em;"><span style="clip: rect(1.319em, 1000em, 3.879em, -0.503em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-42"><span class="msubsup" id="MathJax-Span-43"><span style="display: inline-block; height: 0px; position: relative; width: 2.347em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-44" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.227em;"><span class="texatom" id="MathJax-Span-45"><span class="mrow" id="MathJax-Span-46"><span class="mi" id="MathJax-Span-47" style="font-size: 70.7%; font-style: italic;">S<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.023em;"></span></span><span class="mi" id="MathJax-Span-48" style="font-size: 70.7%; font-style: italic;">N<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.06em;"></span></span><span class="mi" id="MathJax-Span-49" style="font-size: 70.7%; font-style: italic;">R</span></span></span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-50" style="padding-left: 0.278em;">=</span><span class="mfrac" id="MathJax-Span-51" style="padding-left: 0.398em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 1.396em;"><span style="clip: rect(3.127em, 1000em, 4.324em, -0.503em); left: 50%; margin-left: -0.548em; position: absolute; top: -4.665em;"><span class="msubsup" id="MathJax-Span-52"><span style="display: inline-block; height: 0px; position: relative; width: 1.097em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-53" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.231em;"><span class="mi" id="MathJax-Span-54" style="font-size: 70.7%; font-style: italic;">s</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span style="display: inline-block; height: 3.988em; width: 0px;"></span></span><span style="clip: rect(3.127em, 1000em, 4.324em, -0.503em); left: 50%; margin-left: -0.638em; position: absolute; top: -3.302em;"><span class="msubsup" id="MathJax-Span-55"><span style="display: inline-block; height: 0px; position: relative; width: 1.276em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-56" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.231em;"><span class="mi" id="MathJax-Span-57" style="font-size: 70.7%; font-style: italic;">w</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span style="display: inline-block; height: 3.988em; width: 0px;"></span></span><span style="clip: rect(0.818em, 1000em, 1.25em, -0.536em); left: 0em; position: absolute; top: -1.291em;"><span style="border-left: 1.396em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.071em; width: 0px;"></span></span></span></span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 2.787em; overflow: hidden; vertical-align: -1.084em; width: 0px;"></span></span></nobr></span></div>
<span style="font-family: inherit;">If we've received a noise corrupted signal <span class="MathJax_Preview"></span><span class="MathJax" id="MathJax-Element-5-Frame" role="textbox"><nobr><span class="math" id="MathJax-Span-58" style="display: inline-block; width: 9.375em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 7.798em;"><span style="clip: rect(1.929em, 1000em, 3.286em, -0.501em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-59"><span class="mi" id="MathJax-Span-60" style="font-style: italic;">x</span><span class="mo" id="MathJax-Span-61">[</span><span class="mi" id="MathJax-Span-62" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-63">]</span><span class="mo" id="MathJax-Span-64" style="padding-left: 0.278em;">=</span><span class="mi" id="MathJax-Span-65" style="font-style: italic; padding-left: 0.278em;">s</span><span class="mo" id="MathJax-Span-66">[</span><span class="mi" id="MathJax-Span-67" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-68">]</span><span class="mo" id="MathJax-Span-69" style="padding-left: 0.222em;">+</span><span class="mi" id="MathJax-Span-70" style="font-style: italic; padding-left: 0.222em;">w</span><span class="mo" id="MathJax-Span-71">[</span><span class="mi" id="MathJax-Span-72" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-73">]</span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 1.343em; overflow: hidden; vertical-align: -0.371em; width: 0px;"></span></span></nobr></span> then we compute the SNR as follows</span><br />
<span style="font-family: inherit;"><span style="font-family: "georgia" , "times new roman" , serif;"><span class="MathJax_Preview"></span><br /></span>
</span><br />
<div class="MathJax_Display" role="textbox" style="text-align: center;">
<span class="MathJax" id="MathJax-Element-6-Frame"><nobr><span class="math" id="MathJax-Span-74" style="display: inline-block; font-family: inherit; width: 15.589em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 12.976em;"><span style="clip: rect(1.319em, 1000em, 4.222em, -0.503em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-75"><span class="msubsup" id="MathJax-Span-76"><span style="display: inline-block; height: 0px; position: relative; width: 2.347em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-77" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.227em;"><span class="texatom" id="MathJax-Span-78"><span class="mrow" id="MathJax-Span-79"><span class="mi" id="MathJax-Span-80" style="font-size: 70.7%; font-style: italic;">S<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.023em;"></span></span><span class="mi" id="MathJax-Span-81" style="font-size: 70.7%; font-style: italic;">N<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.06em;"></span></span><span class="mi" id="MathJax-Span-82" style="font-size: 70.7%; font-style: italic;">R</span></span></span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-83" style="padding-left: 0.278em;">=</span><span class="mfrac" id="MathJax-Span-84" style="padding-left: 0.398em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 1.396em;"><span style="clip: rect(3.127em, 1000em, 4.324em, -0.503em); left: 50%; margin-left: -0.548em; position: absolute; top: -4.665em;"><span class="msubsup" id="MathJax-Span-85"><span style="display: inline-block; height: 0px; position: relative; width: 1.097em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-86" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.231em;"><span class="mi" id="MathJax-Span-87" style="font-size: 70.7%; font-style: italic;">s</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span style="display: inline-block; height: 3.988em; width: 0px;"></span></span><span style="clip: rect(3.127em, 1000em, 4.324em, -0.503em); left: 50%; margin-left: -0.638em; position: absolute; top: -3.302em;"><span class="msubsup" id="MathJax-Span-88"><span style="display: inline-block; height: 0px; position: relative; width: 1.276em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-89" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.231em;"><span class="mi" id="MathJax-Span-90" style="font-size: 70.7%; font-style: italic;">w</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span style="display: inline-block; height: 3.988em; width: 0px;"></span></span><span style="clip: rect(0.818em, 1000em, 1.25em, -0.536em); left: 0em; position: absolute; top: -1.291em;"><span style="border-left: 1.396em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.071em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-91" style="padding-left: 0.278em;">=</span><span class="mfrac" id="MathJax-Span-92" style="padding-left: 0.398em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 5.671em;"><span style="clip: rect(3.127em, 1000em, 4.324em, -0.503em); left: 50%; margin-left: -0.548em; position: absolute; top: -4.665em;"><span class="msubsup" id="MathJax-Span-93"><span style="display: inline-block; height: 0px; position: relative; width: 1.097em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-94" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.231em;"><span class="mi" id="MathJax-Span-95" style="font-size: 70.7%; font-style: italic;">s</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span style="display: inline-block; height: 3.988em; width: 0px;"></span></span><span style="clip: rect(2.862em, 1000em, 4.417em, -0.417em); left: 50%; margin-left: -2.776em; position: absolute; top: -3.051em;"><span class="msubsup" id="MathJax-Span-96"><span style="display: inline-block; height: 0px; position: relative; width: 5.551em;"><span style="clip: rect(1.929em, 1000em, 3.286em, -0.417em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-97"><span class="mo" id="MathJax-Span-98" style="vertical-align: 0em;">|</span><span class="mi" id="MathJax-Span-99" style="font-style: italic;">x</span><span class="mo" id="MathJax-Span-100">[</span><span class="mi" id="MathJax-Span-101" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-102">]</span><span class="mo" id="MathJax-Span-103" style="padding-left: 0.222em;">−</span><span class="mi" id="MathJax-Span-104" style="font-style: italic; padding-left: 0.222em;">s</span><span class="mo" id="MathJax-Span-105">[</span><span class="mi" id="MathJax-Span-106" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-107">]</span><span class="mo" id="MathJax-Span-108" style="vertical-align: 0em;">|</span><span style="border-left: 0em solid; display: inline-block; height: 0.75em; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="border-left: 0em solid; display: inline-block; height: 0.75em; overflow: hidden; vertical-align: 0em; width: 0px;"></span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span><span style="left: 5.119em; position: absolute; top: -2.858em;"><span class="mn" id="MathJax-Span-109" style="font-size: 70.7%;">2</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span style="display: inline-block; height: 3.988em; width: 0px;"></span></span><span style="clip: rect(0.818em, 1000em, 1.25em, -0.536em); left: 0em; position: absolute; top: -1.291em;"><span style="border-left: 5.671em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.071em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-110" style="padding-left: 0.167em;">.</span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 3.198em; overflow: hidden; vertical-align: -1.495em; width: 0px;"></span></span></nobr></span></div>
<span style="font-family: inherit;">Here <span class="MathJax_Preview"></span><span class="MathJax" id="MathJax-Element-7-Frame" role="textbox"><nobr><span class="math" id="MathJax-Span-111" style="display: inline-block; width: 6.661em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 5.536em;"><span style="clip: rect(1.135em, 1000em, 2.69em, -0.417em); left: 0em; position: absolute; top: -2.262em;"><span class="mrow" id="MathJax-Span-112"><span class="msubsup" id="MathJax-Span-113"><span style="display: inline-block; height: 0px; position: relative; width: 5.551em;"><span style="clip: rect(1.929em, 1000em, 3.286em, -0.417em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-114"><span class="mo" id="MathJax-Span-115" style="vertical-align: 0em;">|</span><span class="mi" id="MathJax-Span-116" style="font-style: italic;">x</span><span class="mo" id="MathJax-Span-117">[</span><span class="mi" id="MathJax-Span-118" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-119">]</span><span class="mo" id="MathJax-Span-120" style="padding-left: 0.222em;">−</span><span class="mi" id="MathJax-Span-121" style="font-style: italic; padding-left: 0.222em;">s</span><span class="mo" id="MathJax-Span-122">[</span><span class="mi" id="MathJax-Span-123" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-124">]</span><span class="mo" id="MathJax-Span-125" style="vertical-align: 0em;">|</span><span style="border-left: 0em solid; display: inline-block; height: 0.75em; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="border-left: 0em solid; display: inline-block; height: 0.75em; overflow: hidden; vertical-align: 0em; width: 0px;"></span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span><span style="left: 5.119em; position: absolute; top: -2.858em;"><span class="mn" id="MathJax-Span-126" style="font-size: 70.7%;">2</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span></span><span style="display: inline-block; height: 2.262em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 1.58em; overflow: hidden; vertical-align: -0.371em; width: 0px;"></span></span></nobr></span>
is simply the squared error between original and corrupted signals.
Note that if we scaled the definition of power by the number of points
in the signal, this would have been the <em>mean</em> squared error (MSE) but since we're dealing with ratios of powers, the result stays the same.</span><br />
<span style="font-family: inherit;">Let us now interpret this result. This is the ratio of the power of
signal to the power of noise. Power is in some sense the squared norm of
your signal. It shows how much squared deviation you have from zero on
average.</span><br />
<span style="font-family: inherit;">You should also note that we can extend this notion to images by
simply summing twice of rows and columns of your image vector, or simply
stretching your entire image into a single vector of pixels and apply
the one-dimensional definition. You can see that no spacial information
is encoded into the definition of power.</span><br />
<span style="font-family: inherit;">Now let's look at peak signal to noise ratio. This definition is </span><br />
<span style="font-family: inherit;"><span style="font-family: "georgia" , "times new roman" , serif;"><span class="MathJax_Preview"></span><br /></span>
</span><br />
<div class="MathJax_Display" role="textbox" style="text-align: center;">
<span class="MathJax" id="MathJax-Element-8-Frame"><nobr><span class="math" id="MathJax-Span-127" style="display: inline-block; font-family: inherit; width: 11.589em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 9.643em;"><span style="clip: rect(1.106em, 1000em, 3.752em, -0.503em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-128"><span class="msubsup" id="MathJax-Span-129"><span style="display: inline-block; height: 0px; position: relative; width: 2.823em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-130" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.227em;"><span class="texatom" id="MathJax-Span-131"><span class="mrow" id="MathJax-Span-132"><span class="mi" id="MathJax-Span-133" style="font-size: 70.7%; font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.077em;"></span></span><span class="mi" id="MathJax-Span-134" style="font-size: 70.7%; font-style: italic;">S<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.023em;"></span></span><span class="mi" id="MathJax-Span-135" style="font-size: 70.7%; font-style: italic;">N<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.06em;"></span></span><span class="mi" id="MathJax-Span-136" style="font-size: 70.7%; font-style: italic;">R</span></span></span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-137" style="padding-left: 0.278em;">=</span><span class="mfrac" id="MathJax-Span-138" style="padding-left: 0.398em; padding-right: 0.12em;"><span style="display: inline-block; height: 0px; position: relative; width: 4.822em;"><span style="clip: rect(1.845em, 1000em, 3.286em, -0.536em); left: 50%; margin-left: -2.351em; position: absolute; top: -3.596em;"><span class="mrow" id="MathJax-Span-139"><span class="mtext" id="MathJax-Span-140">max</span><span class="mo" id="MathJax-Span-141">(</span><span class="msubsup" id="MathJax-Span-142"><span style="display: inline-block; height: 0px; position: relative; width: 0.908em;"><span style="clip: rect(1.998em, 1000em, 2.808em, -0.483em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-143" style="font-style: italic;">s</span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.476em; position: absolute; top: -2.744em;"><span class="mn" id="MathJax-Span-144" style="font-size: 70.7%;">2</span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-145">[</span><span class="mi" id="MathJax-Span-146" style="font-style: italic;">n</span><span class="mo" id="MathJax-Span-147">]</span><span class="mo" id="MathJax-Span-148">)</span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span><span style="clip: rect(1.974em, 1000em, 3.058em, -0.536em); left: 50%; margin-left: -1.071em; position: absolute; top: -2.163em;"><span class="mtext" id="MathJax-Span-149">MSE</span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span><span style="clip: rect(0.818em, 1000em, 1.25em, -0.536em); left: 0em; position: absolute; top: -1.291em;"><span style="border-left: 4.822em solid; display: inline-block; height: 1.25px; overflow: hidden; vertical-align: 0em; width: 0px;"></span><span style="display: inline-block; height: 1.071em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-150" style="padding-left: 0.167em;">.</span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 2.889em; overflow: hidden; vertical-align: -0.93em; width: 0px;"></span></span></nobr></span></div>
<span style="font-family: inherit;"><span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">If you stare at this for long enough you will realize that this definition is really the same as that of <span class="MathJax_Preview"></span><span class="MathJax" id="MathJax-Element-9-Frame" role="textbox"><nobr><span class="math" id="MathJax-Span-151" style="display: inline-block; width: 2.804em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 2.321em;"><span style="clip: rect(1.4em, 1000em, 2.61em, -0.503em); left: 0em; position: absolute; top: -2.262em;"><span class="mrow" id="MathJax-Span-152"><span class="msubsup" id="MathJax-Span-153"><span style="display: inline-block; height: 0px; position: relative; width: 2.347em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-154" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.227em;"><span class="texatom" id="MathJax-Span-155"><span class="mrow" id="MathJax-Span-156"><span class="mi" id="MathJax-Span-157" style="font-size: 70.7%; font-style: italic;">S<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.023em;"></span></span><span class="mi" id="MathJax-Span-158" style="font-size: 70.7%; font-style: italic;">N<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.06em;"></span></span><span class="mi" id="MathJax-Span-159" style="font-size: 70.7%; font-style: italic;">R</span></span></span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span></span><span style="display: inline-block; height: 2.262em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 1.166em; overflow: hidden; vertical-align: -0.275em; width: 0px;"></span></span></nobr></span> except that the numerator of the ratio is now the <em>maximum</em> squared intensity of the signal, not the <em>average</em> one. This makes this criterion less strict. You can see that <span class="MathJax_Preview"></span><span class="MathJax" id="MathJax-Element-10-Frame" role="textbox"><nobr><span class="math" id="MathJax-Span-160" style="display: inline-block; width: 7.804em;"><span style="display: inline-block; font-size: 120%; height: 0px; position: relative; width: 6.488em;"><span style="clip: rect(1.996em, 1000em, 3.205em, -0.503em); left: 0em; position: absolute; top: -2.857em;"><span class="mrow" id="MathJax-Span-161"><span class="msubsup" id="MathJax-Span-162"><span style="display: inline-block; height: 0px; position: relative; width: 2.823em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-163" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.227em;"><span class="texatom" id="MathJax-Span-164"><span class="mrow" id="MathJax-Span-165"><span class="mi" id="MathJax-Span-166" style="font-size: 70.7%; font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.077em;"></span></span><span class="mi" id="MathJax-Span-167" style="font-size: 70.7%; font-style: italic;">S<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.023em;"></span></span><span class="mi" id="MathJax-Span-168" style="font-size: 70.7%; font-style: italic;">N<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.06em;"></span></span><span class="mi" id="MathJax-Span-169" style="font-size: 70.7%; font-style: italic;">R</span></span></span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span><span class="mo" id="MathJax-Span-170" style="padding-left: 0.278em;">≤</span><span class="msubsup" id="MathJax-Span-171" style="padding-left: 0.278em;"><span style="display: inline-block; height: 0px; position: relative; width: 2.347em;"><span style="clip: rect(1.757em, 1000em, 2.798em, -0.503em); left: 0em; position: absolute; top: -2.619em;"><span class="mi" id="MathJax-Span-172" style="font-style: italic;">P<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.109em;"></span></span><span style="display: inline-block; height: 2.619em; width: 0px;"></span></span><span style="left: 0.665em; position: absolute; top: -2.227em;"><span class="texatom" id="MathJax-Span-173"><span class="mrow" id="MathJax-Span-174"><span class="mi" id="MathJax-Span-175" style="font-size: 70.7%; font-style: italic;">S<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.023em;"></span></span><span class="mi" id="MathJax-Span-176" style="font-size: 70.7%; font-style: italic;">N<span style="display: inline-block; height: 1px; overflow: hidden; width: 0.06em;"></span></span><span class="mi" id="MathJax-Span-177" style="font-size: 70.7%; font-style: italic;">R</span></span></span><span style="display: inline-block; height: 2.381em; width: 0px;"></span></span></span></span></span><span style="display: inline-block; height: 2.857em; width: 0px;"></span></span></span><span style="border-left: 0em solid; display: inline-block; height: 1.166em; overflow: hidden; vertical-align: -0.275em; width: 0px;"></span></span></nobr></span> and that they will only be equal to each pother if your original clean signal is constant everywhere.</span></span><br />
<span style="font-family: inherit;">Now, why does this definition make sense? It makes sense because the
case of SNR we're looking at how strong the signal is to how strong the
noise is. We assume that there are no special circumstances. In fact,
this definition is adapted directly from the physical definition of
electrical power. In case of PSNR, we're interested in signal peak
because we can be interested in things like the bandwidth of the
signal, or number of bits we need to represent it. This is much more
content-specific than pure SNR and can find many reasonable
applications, image compression being on of them. Here we're saying that
what matters is how well high-intensity regions of the image come
through the noise, and we're paying much less attention how we're
performing under low intensity.</span></div>
</td></tr>
</tbody></table>
</div>
prem888http://www.blogger.com/profile/06697980223859507647noreply@blogger.com0tag:blogger.com,1999:blog-1589444629860688097.post-27396273492912058712013-11-17T14:42:00.000+05:302016-09-01T14:46:06.358+05:30What is Time domain and Frequency domain?<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<span style="background-color: white; font-family: 'Josefin Sans'; line-height: 21px;">Time/Frequency are interrelated parameter of a signal and both representations are two views of a same signal. </span>Most of the time in <span class="GramE">practice,</span> the signal measuring, is a
function of time. That is TIME-DOMAIN. In other words, when we plot the signal one of the axes is
time (independent variable), and the other (dependent variable) is usually the
amplitude. When we plot time-domain signals, we obtain a <b>time-amplitude
representation</b> of the signal. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6NA8j4ZJNewXrk0Zehmtp_HVrzKHokcI3q-C0a_dS52D82H-xm4E6AGgsQTUk5s5fv68WHYw6kbJpccfbwB52wneEggPCyovjRZuj5dO4fGx4a2hSymMDccKQQlV00Kq2qxUX4IuG0-hQ/s1600/wave_time-domain.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="189" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6NA8j4ZJNewXrk0Zehmtp_HVrzKHokcI3q-C0a_dS52D82H-xm4E6AGgsQTUk5s5fv68WHYw6kbJpccfbwB52wneEggPCyovjRZuj5dO4fGx4a2hSymMDccKQQlV00Kq2qxUX4IuG0-hQ/s320/wave_time-domain.gif" width="320" /></a></div>
<br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This representation is not always the best
representation of the signal for most signal processing related applications.
In many cases, the most distinguished information is hidden in the frequency
content of the signal. The <b>frequency SPECTRUM</b> of a signal is basically
the frequency components (spectral components) of that signal. The frequency
spectrum of a signal shows what frequencies exist in the signal. The below represents a signal in time domain and frequency domain.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgapZpTv-mErIm8_vHiaabUD6_lax6nyQbgD5APyUEYrvT7FX-A0oCl5qvlIlATVN6QSBXweNDFCoh4ZlcJqqmLH-8loUVG_v4ujqfmI_XeL7e3cpLHscIFATmp32AAzqdDAxmeD-Ru04vB/s1600/TimeDomain.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgapZpTv-mErIm8_vHiaabUD6_lax6nyQbgD5APyUEYrvT7FX-A0oCl5qvlIlATVN6QSBXweNDFCoh4ZlcJqqmLH-8loUVG_v4ujqfmI_XeL7e3cpLHscIFATmp32AAzqdDAxmeD-Ru04vB/s320/TimeDomain.gif" width="320" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Demo :</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMzvUXfBbFzgcETqG4LCKWPxOX66SWZ5GUTxCkSoTaWE62tgXMZ3rY1v5525AQEMOkz38cEXYzd5l6axLcQMaiccdQsCyCzxNOj3-zyW-RXtTpnZ_iNQ4RMu1qEeFFPhK5nUCvd57LM2po/s1600/Fourier_transform_time_and_frequency_domains.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMzvUXfBbFzgcETqG4LCKWPxOX66SWZ5GUTxCkSoTaWE62tgXMZ3rY1v5525AQEMOkz38cEXYzd5l6axLcQMaiccdQsCyCzxNOj3-zyW-RXtTpnZ_iNQ4RMu1qEeFFPhK5nUCvd57LM2po/s320/Fourier_transform_time_and_frequency_domains.gif" width="320" /></a></div>
Here the square like wave f is the time domain and it contains 6 different frequencies in it but we are unable to see this information when we are just looking at the TIME DOMAIN representation. So when we take fourier transform of the time domain signal, it reveals the number of frequency it has with amplitude of those frequencies. This is said to be the Frequency Domain.<br />
<br />
In the above demo :<br />
<br />
Red Color --- TIME DOMAIN SIGNAL<br />
Blue Color --- FREQUENCY DOMAIN SIGNAL<br />
<br />
<u><b>MATLAB Code:</b></u><br />
<br />
<pre id="pre6" style="margin-top: 0px;">clear all;
clc;
close all;
f=50;
A=5;
Fs=f*<span class="code-digit">100</span>;
Ts=1/Fs;
t=0:Ts:10/f;
x=A*sin(<span class="code-digit">2</span>*pi*f*t);
x1=A*sin(<span class="code-digit">2</span>*pi*(f+50)*t);
x2=A*sin(<span class="code-digit">2</span>*pi*(f+250)*t);
x=x+x1+x2; % Creating Hybrid signal which will have more than 1 frequency.
plot(x)
F=fft(x);
figure
N=Fs/length(F);
baxis=(<span class="code-digit">1</span>:N:N*(length(x)/2-<span class="code-digit">1</span>));
plot(baxis,real(F(<span class="code-digit">1</span>:length(F)/2))) </pre>
<br />
<pre class="greybox"></pre>
</div>
prem888http://www.blogger.com/profile/06697980223859507647noreply@blogger.com2tag:blogger.com,1999:blog-1589444629860688097.post-81364795415141118032013-11-17T14:08:00.002+05:302016-01-19T10:56:32.794+05:30Ideal Low Pass Filter Concept in MATLAB<div dir="ltr" style="text-align: left;" trbidi="on">
<pre><span style="font-family: inherit;"><code></code></span></pre>
<pre><code><span style="font-family: inherit;">%IDEAL LOW-PASS FILTER
%Part 1
f=imread(X); % reading an image X</span></code></pre>
<pre><code><span style="font-family: inherit;"> P=input('Enter the cut-off frequency'); % 10, 20, 40 or 50.</span></code></pre>
<pre><code><span style="font-family: inherit;"> [M,N]=size(f); % Saving the the rows of X in M and columns in N
F=fft2(double(f)); % Taking Fourier transform to the input image
%Part 2 % Finding the distance matrix D which is required to create the filter mask
u=0:(M-1);
v=0:(N-1);
idx=find(u>M/2);
u(idx)=u(idx)-M;
idy=find(v>N/2);
v(idy)=v(idy)-N;
[V,U]=meshgrid(v,u);
D=sqrt(U.^2+V.^2);
%Part 3
H=double(D<=P); % Comparing with the cut-off frequency to create filter mask
G=H.*F; % Multiplying the Fourier transformed image with H
g=real(ifft2(double(G))); % Inverse Fourier transform
imshow(f),figure,imshow(g,[ ]); % Displaying input and output image
end</span></code></pre>
<pre><code><span style="font-family: inherit;"> </span></code></pre>
<pre><code><span style="font-family: inherit;"> </span></code></pre>
<pre><code><span style="font-family: inherit;">Demo:</span></code></pre>
<pre><code><span style="font-family: inherit;"> </span></code></pre>
<pre><code><span style="font-family: inherit;">Reading an image:</span></code></pre>
<pre><code><span style="font-family: inherit;"> </span></code></pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXuuFxGvbo-wsnhhgzd2j3hlHkd4Cdz6upsakOusQbe1WTfQMSw10lqLbhDNFormHbEPh5YV6jt0RTY6ZF1ee8LplPOfWm54NWmz4qL-dNoqa5920ve-dfewSD5L0sEVDtee23P-_YuOf7/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXuuFxGvbo-wsnhhgzd2j3hlHkd4Cdz6upsakOusQbe1WTfQMSw10lqLbhDNFormHbEPh5YV6jt0RTY6ZF1ee8LplPOfWm54NWmz4qL-dNoqa5920ve-dfewSD5L0sEVDtee23P-_YuOf7/s400/1.jpg" width="400" /></span></a></div>
<span style="font-family: inherit;">Taking fourier transform of the above image, we get:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmfj8q0ffXVEGPDcDAk9rw5azql_xLnbOYSIqh6ctGc4kD6xkUv_iYhcWnnDTOuGs1BSiI8qgZUVU_r0JMoJJs2RG73o_qIoO0tkSVhWH9PaGSWkLbaQyEda7ro9l7H0KyRML-SgAmklQT/s1600/2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmfj8q0ffXVEGPDcDAk9rw5azql_xLnbOYSIqh6ctGc4kD6xkUv_iYhcWnnDTOuGs1BSiI8qgZUVU_r0JMoJJs2RG73o_qIoO0tkSVhWH9PaGSWkLbaQyEda7ro9l7H0KyRML-SgAmklQT/s400/2.jpg" width="400" /></span></a></div>
<span style="font-family: inherit;"> Based on the cut-off freq (P) we design the filter function H , Here the cut-off frequency is nothing but radius of the white circle in the below image. The below image is usually referred as filter mask.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC0aa3LOaqQYiitFIPNF9giucYI1-RKAqCU-NARmTad_fS57KyDMVg_gVwn0AL4aWsl4zkoDy2ifnYr3rC195osrPnahC3yJPo4SezGMYtw1SgcKh_7ZHAowvXM_LmCDS7akWE5kHMh9IB/s1600/3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"> <img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC0aa3LOaqQYiitFIPNF9giucYI1-RKAqCU-NARmTad_fS57KyDMVg_gVwn0AL4aWsl4zkoDy2ifnYr3rC195osrPnahC3yJPo4SezGMYtw1SgcKh_7ZHAowvXM_LmCDS7akWE5kHMh9IB/s400/3.jpg" width="400" /></span></a></div>
<span style="font-family: inherit;"><br /></span>
<pre style="text-align: justify;"><span style="font-family: inherit;"><span style="font-family: Times,"Times New Roman",serif;"><code>Performing filtering by using G=H.*F;% Multiplying the Fourier transformed </code></span>image with the filter mask H. Please note the convolution in time domain to equal to multiplication in frequency domain.</span></pre>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRNRGLi4tTpM9O7QVG8Z6GKMLEBspysmv97-W-EeCOGiP2-XlUjcTG-wjEIzsZWqI5zdLfYpE1KrAAkOMlsmeJLlp7BOGexZMM63BeondZdNxjn7oMkeR4g42Ya0RGm3rxBsmIDYmqGtfw/s1600/4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRNRGLi4tTpM9O7QVG8Z6GKMLEBspysmv97-W-EeCOGiP2-XlUjcTG-wjEIzsZWqI5zdLfYpE1KrAAkOMlsmeJLlp7BOGexZMM63BeondZdNxjn7oMkeR4g42Ya0RGm3rxBsmIDYmqGtfw/s400/4.jpg" width="400" /></span></a></div>
<span style="font-family: inherit;"> To the filtered output, we take inverse fourier transform for the above image and we get:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-n-obaYwuxxcSJkTTLGBInV0HxKhMokY3TTNMBSVo2zzQO3r7DojdU9eoDxCWYVmdY-Jv_Gf2cZQM4u8wVa8IZMGT_A3Yf6UEKuByMral1O04O4bqUXN9uTExli_KdU7w1eZ4xs_T7rjL/s1600/5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: inherit;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-n-obaYwuxxcSJkTTLGBInV0HxKhMokY3TTNMBSVo2zzQO3r7DojdU9eoDxCWYVmdY-Jv_Gf2cZQM4u8wVa8IZMGT_A3Yf6UEKuByMral1O04O4bqUXN9uTExli_KdU7w1eZ4xs_T7rjL/s400/5.jpg" width="400" /></span></a></div>
<pre><code><span style="font-family: inherit;"> This is the Ideal Low pass filtered image. </span></code></pre>
</div>
prem888http://www.blogger.com/profile/06697980223859507647noreply@blogger.com1tag:blogger.com,1999:blog-1589444629860688097.post-40236182109850844752013-11-13T15:10:00.001+05:302013-11-13T21:10:24.916+05:30What is Digital Image Processing?<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
I will be using simple language to explain the concepts. To understand Digital Image Processing, let us see each word individually.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<u><b>Image:</b></u></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
For standard definitions about image you can refer to the wikipedia page : <a href="http://en.wikipedia.org/wiki/Image" target="_blank">Image Definition</a> . If you have any difficulty in understanding that definitions, here is my definition for the image.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
"Image" is the visual representation of information. That's it. Short and simple. If you are a person who isn't sure what the word "information" means, read further. "Information" is description of something or anything. To understand what the "visual representation" means here, read the below example.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I already told that "Information" is description of something. For example, my physical description is "Male, Young, Average height, Short hair, and Casually dressed". Here I have described my physical appearance in text, this is said to be representing an information through text. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The same information if I had communicated to someone through my speech, it is said to be representing an information through audio. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Similarly, the same information can be represented visually if I take a picture of myself and post it here.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8jNnBgvpH-cUJlVHO_PP9CqA13-7P4w87wCRGGiej9ixCRJAnNyEXzOsOYzvCK_-5awj_NrqsoJWvnosndJpsaT4TbCwfuijDno_7jxTobYlL641BOMQZI-UD3RdxmD99I_YWclpBAd9z/s1600/new123.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8jNnBgvpH-cUJlVHO_PP9CqA13-7P4w87wCRGGiej9ixCRJAnNyEXzOsOYzvCK_-5awj_NrqsoJWvnosndJpsaT4TbCwfuijDno_7jxTobYlL641BOMQZI-UD3RdxmD99I_YWclpBAd9z/s1600/new123.jpg" /></a></div>
<br />
<div style="text-align: justify;">
The above image also conveys the same information i.e) "Male, Young, Average height, Short hair, and Casually dressed" but it is represented visually. So we have now learned what is an image in an unconventional way.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<u><b>Digital:</b></u></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
A <b>digital image</b> is a numeric representation of a two-dimensional image. It will have pixel values are numerical.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
What is pixel ?</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Pixel is a smallest sample in an image. To understand what is pixel, you must know how the images are captured digitally(without using film rolls). Watch the below video:</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dzdtVYyzjalQECaRAN2_X0y_XjbUxXYEXG6UiBB52vkcVbULtTpLFHDmSpq9M3tvQsLP1XbYm5ts9FVgrATTA' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<br />
Youtube Link: <a href="http://www.youtube.com/watch?v=FLHvp0YuawQ&feature=youtu.be" target="_blank">How to capture image digitally</a><br />
<br />
I believe you have seen the above mentioned video. The smallest unit in the CMOS sensor is said to be the picture element. The term PIXEL is derived from this "<b>PIC</b>ture <b>EL</b>ement". When the light reflected from the object that has to be captured hits this picture element in the CMOS sensor, the light energy is converted into electrical signals then this electrical signal converted into digital data (numerical value) using Analog to Digital Converter while saving to the memory card. So the image is now captured digitally.<br />
<br />
<u><b> Processing:</b></u><br />
<br />
Now that we have captured an image digitally. We to do perform some operation on the captured image to improve its perceived quality (It is said to be Image enhancement), reduce the size for storage and transmission (Image Compression) and etc.<br />
<br />
Here is the block diagram for different processes that are done for digital images:<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfxBfUZOLFVOIKnZZFTP5-028hobVI4TtW8n3Hz5pqV63P8v9AaLjugwm1cw6CT499KiVKUqvzfgSNhgDIdvzJwx9QrtDxqOrKPJH4ANeNj3xMJTx3p1nUx-nxuAOZ2j21UwRl01vztjzr/s1600/dip.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="354" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfxBfUZOLFVOIKnZZFTP5-028hobVI4TtW8n3Hz5pqV63P8v9AaLjugwm1cw6CT499KiVKUqvzfgSNhgDIdvzJwx9QrtDxqOrKPJH4ANeNj3xMJTx3p1nUx-nxuAOZ2j21UwRl01vztjzr/s640/dip.jpg" width="640" /></a> <br />
<br />
I hope this give you the basic understanding of Digital Image Processing.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfxBfUZOLFVOIKnZZFTP5-028hobVI4TtW8n3Hz5pqV63P8v9AaLjugwm1cw6CT499KiVKUqvzfgSNhgDIdvzJwx9QrtDxqOrKPJH4ANeNj3xMJTx3p1nUx-nxuAOZ2j21UwRl01vztjzr/s1600/dip.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br /></div>
prem888http://www.blogger.com/profile/06697980223859507647noreply@blogger.com0tag:blogger.com,1999:blog-1589444629860688097.post-32580407625473174002013-11-13T13:27:00.002+05:302013-11-13T13:29:20.268+05:30Thirukural<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Quote:</b> <br />
<blockquote>
<i>In sandy soil, when deep you delve, you reach the springs below; <br />The more you learn, the freer streams of wisdom flow.</i></blockquote>
<b>Explanation:</b> <br />
<blockquote>
<i><span style="font-family: lucida grande;">Water
will flow from a well in the sand in proportion to the depth to which
it is dug, and knowledge will flow from a man in proportion to his
learning.</span></i></blockquote>
<b>Quote:</b> <br />
<blockquote>
<i>So learn that you may full and faultless learning gain, <br />Then in obedience meet to lessons learnt remain.</i></blockquote>
<b>Explanation:</b> <br />
<blockquote>
<i><span style="font-family: lucida grande;">Let a man learn thoroughly whatever he may learn, and let his conduct be worthy of his learning.</span></i></blockquote>
</div>
prem888http://www.blogger.com/profile/06697980223859507647noreply@blogger.com0