{"id":856,"date":"2013-07-10T12:01:05","date_gmt":"2013-07-10T16:01:05","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/?p=856"},"modified":"2019-11-01T09:21:00","modified_gmt":"2019-11-01T13:21:00","slug":"homomorphic-filtering-part-2","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2013\/07\/10\/homomorphic-filtering-part-2\/","title":{"rendered":"Homomorphic filtering &#8211; part 2"},"content":{"rendered":"<div class=\"content\"><p><i>I'd like to welcome back guest blogger Spandan Tiwari for the second post in his two-part series on homomorphic filtering.<\/i><\/p><p><a href=\"https:\/\/blogs.mathworks.com\/steve\/2013\/06\/25\/homomorphic-filtering-part-1\/\">Last time<\/a> we looked at how to apply a simple homomorphic filter. Today we continue our discussion on homomorphic filtering. First I'll load the variables <tt>I<\/tt>, <tt>H<\/tt>, and <tt>Ihmf<\/tt> that I computed last time.<\/p><pre class=\"codeinput\">load <span class=\"string\">homomorphic_part1<\/span>\r\n<\/pre><p>In homomorphic filtering we apply a high-pass filter to the log-transformed image. The high-pass filtering step provides us with an opportunity to simultaneously apply other enhancements to the image. Consider a modified version of the high-pass filter $H(u,v)$ that we used last time.<\/p><p>$$ H_{e}(u,v) = \\alpha + \\beta \\ H(u,v) $$<\/p><p>We added an offset and a scaling factor for the Gaussian high-pass filter. If $\\alpha &lt; 1$ and $\\beta &gt; 1$, this filter will amplify the high-frequency components more than the low-frequency components. This filter is called <i>high-frequency emphasis<\/i> filter. The resulting image, typically, is sharper and also has better contrast. We choose $\\alpha = 0.5$ and $\\beta = 1.5$, and formulate the high-frequency emphasis filter.<\/p><pre class=\"codeinput\">alpha = 0.5;\r\nbeta = 1.5;\r\nHemphasis = alpha + beta*H;\r\n<\/pre><p>Let's compare the original high-pass filter and the high-frequency emphasis filter by looking at their cross-sections.<\/p><pre class=\"codeinput\">plot(1:30,H(1,1:30),<span class=\"string\">'r'<\/span>,1:30,Hemphasis(1,1:30),<span class=\"string\">'b'<\/span>,<span class=\"string\">'LineWidth'<\/span>,2);\r\ngrid <span class=\"string\">on<\/span>;\r\nlegend(<span class=\"string\">'High-pass Filter'<\/span>,<span class=\"string\">'High-frequency Emphasis Filter'<\/span>,<span class=\"string\">'Location'<\/span>,<span class=\"string\">'best'<\/span>);\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_01.jpg\" alt=\"\"> <p>Now let's apply the filter and look at the result of homomorphic filtering. The image below shows the original (on the left) and the homomorphic filtered (on the right) images together. If you compare the two images you can see that the gradual change in illumination in the left image has been corrected to a large extent in the image on the right.<\/p><pre class=\"codeinput\">If = fft2(I, M, N);\r\nIout = real(ifft2(Hemphasis.*If));\r\nIout = Iout(1:size(I,1),1:size(I,2));\r\n\r\nIhmf_2 = exp(Iout) - 1;\r\n\r\nimshowpair(I, Ihmf_2, <span class=\"string\">'montage'<\/span>)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_02.jpg\" alt=\"\"> <p>The non-uniform illumination has largely been corrected. Now let's compare our earlier result of homomorphic filtering with regular high-pass filter (below, left) and the result with high-frequency emphasis filter (below, right). We see that the latter seems to have better non-uniform illumination compensation of the two.<\/p><pre class=\"codeinput\">imshowpair(Ihmf, Ihmf_2, <span class=\"string\">'montage'<\/span>)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_03.jpg\" alt=\"\"> <p>Also, looking at these two images side-by-side highlights an interesting effect. In the image on the left there seems to be a bright <i>halo type<\/i> artifact on the borders. This can be seen more clearly if we increase the contrast by applying histogram equalization on the image on the left using the <a href=\"https:\/\/www.mathworks.com\/help\/images\/ref\/histeq.html\">histeq<\/a> function. Note that I am normalizing the image using <a href=\"https:\/\/www.mathworks.com\/help\/images\/ref\/mat2gray.html\">mat2gray<\/a> before passing it to <tt>histeq<\/tt>.<\/p><pre class=\"codeinput\">imshow(histeq(mat2gray(Ihmf)))\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_04.jpg\" alt=\"\"> <p>The halos on the borders can be seen clearly now. But if you look closely it is not just the image on the left that has the halo effect on the borders. The output from the high-frequency emphasis filter (image on the right) also has a similar, but less-pronounced, halo effect. Let's look at the histogram equalized version of both these images together to make this more apparent.<\/p><pre class=\"codeinput\">imshowpair(histeq(mat2gray(Ihmf)), histeq(mat2gray(Ihmf_2)), <span class=\"string\">'montage'<\/span>)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_05.jpg\" alt=\"\"> <p>So why does this happen? Well, this artifact is because we padded the image with zeros during filtering, and the effect of the zeros <i>leak<\/i> into the image domain. A solution would be to apply a windowing function (such as the Hanning window) instead of zero-padding, before computing the Discrete Fourier Transform. But this solution is not appropriate in our situation because it is the same as introducing another slowly-varying multiplicative  <i>undesired<\/i> signal, just like the non-uniform illumination signal that we are trying to remove. Another way to help the situation is to pad the image by replicating the intensity at the borders of the image instead of padding the image with zeros. Although this won't eliminate the artifacts due to <i>leakage<\/i> completely, it will mitigate their severity. To achieve the <i>replicate<\/i> style padding, we will have to pad the image ourselves, instead of letting <tt>fft2<\/tt> pad it for us. We will use Image Processing Toolbox function <a href=\"https:\/\/www.mathworks.com\/help\/images\/ref\/padarray.html\">padarray<\/a> for this.<\/p><pre class=\"codeinput\">paddedI = padarray(I,ceil(size(I)\/2)+1,<span class=\"string\">'replicate'<\/span>);\r\npaddedI = paddedI(1:end-1,1:end-1);\r\n<\/pre><p>Let's look at the result with the <i>replicate<\/i> style padding. I will show the results only for the high-frequency emphasis filter. We apply the high-frequency emphasis filter to the padded image.<\/p><pre class=\"codeinput\">If = fft2(paddedI);\r\nIout = real(ifft2(Hemphasis.*If));\r\n<\/pre><p>Note that we padded the image on both sides in each dimension. This is unlike <tt>fft2<\/tt> which appends trailing zeros along each dimension. Consequently, the output will also be padded on both sides.<\/p><pre class=\"codeinput\">imshow(Iout)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_06.jpg\" alt=\"\"> <p>While cropping the image back to the original size we have to mindful of this and crop the image around the center of the larger output image.<\/p><pre class=\"codeinput\">Iout = Iout(ceil(M\/2)-size(I,1)\/2+1:ceil(M\/2)+size(I,1)\/2, <span class=\"keyword\">...<\/span>\r\n            ceil(N\/2)-size(I,2)\/2+1:ceil(N\/2)+size(I,2)\/2);\r\n<\/pre><p>Let's apply the exponential and look at the result. The image on the left is the output with zero padding that we computed earlier. The one of the right is the output with <i>replicate<\/i> style padding. We can  see that the halo effect has been mitigated to a large extent.<\/p><pre class=\"codeinput\">Ihmf_3 = exp(Iout) - 1;\r\nimshowpair(Ihmf_2, Ihmf_3, <span class=\"string\">'montage'<\/span>)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_07.jpg\" alt=\"\"> <p>Let's use histogram equalization to get a better a better look.<\/p><pre class=\"codeinput\">imshowpair(histeq(mat2gray(Ihmf_2)), histeq(mat2gray(Ihmf_3)), <span class=\"string\">'montage'<\/span>)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_08.jpg\" alt=\"\"> <p>The halo effect at the border has been mitigated significantly. But we had to do some code mechanics to get homomorphic filtering to play well in the FFT-domain. This is where the spatial domain filtering might offer a better alternative. It is relatively simpler to do the <i>replicate<\/i> style padding in the spatial domain. Let's create a simple spatial domain high-pass filter. Although we can create a spatial kernel exactly equivalent to the frequency-domain Gaussian high-pass filter we used earlier, we won't get into that to keep things simple. Here we make a simple ideal high-pass filter.<\/p><pre class=\"codeinput\">filterRadius = sigma;\r\nfilterSize = 2*filterRadius + 1;\r\nhLowpass = fspecial(<span class=\"string\">'average'<\/span>, filterSize);\r\nhImpulse = zeros(filterSize);\r\nhImpulse(filterRadius+1,filterRadius+1) = 1;\r\nhHighpass = hImpulse - hLowpass;\r\n<\/pre><p>Now we apply this high-pass filter in the spatial domain. To get the <i>replicate<\/i> style padding, we simply specify the <tt>'replicate'<\/tt> option in <a href=\"https:\/\/www.mathworks.com\/help\/images\/ref\/imfilter.html\">imfilter<\/a>. Then we apply the exponential to get the homomorphic filtered image.<\/p><pre class=\"codeinput\">Ihmf_spatial = imfilter(I, hHighpass, <span class=\"string\">'replicate'<\/span>);\r\n\r\nIhmf_spatial = exp(Ihmf_spatial) - 1;\r\n<\/pre><p>Here's the filtered image (right) juxtaposed with the original input image (left).<\/p><pre class=\"codeinput\">imshowpair(I, Ihmf_spatial, <span class=\"string\">'montage'<\/span>)\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_09.jpg\" alt=\"\"> <p>Again, we see that the non-uniform illumination has been corrected to a large extent and there aren't any noticeable border artifacts. To show the absence of the border artifacts let's look at the histogram equalized version of the output. For comparison we will also enhance the output from frequency-domain high-emphasis filtered image (with zero-padding), which is shown on the left. Again, we can see that there aren't any noticeable border artifacts after filtering in the spatial domain (image on the right).<\/p><pre class=\"codeinput\">imshowpair(histeq(mat2gray(Ihmf_2)), histeq(mat2gray(Ihmf_spatial)), <span class=\"string\">'montage'<\/span>);\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_10.jpg\" alt=\"\"> <p>Both frequency domain and spatial domain filtering offer some practical advantages of their own. Spatial domain filtering offers a straightforward way to get the padding right. Also, it might be faster for small kernel sizes. But the frequency domain offers an easier and more intuitive way to get the filter with desired frequency characteristics.<\/p><p>In conclusion, homomorphic filtering is a useful tool to have in your quiver of enhancement techniques. It may not be applicable as a generic enhancement technique, but it works well on a certain set of problems.<\/p><p>Which applications have you used homomorphic filtering for? Were there any specific problems you faced while using it? Let us know.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_a9d7062f8f7640d0acf8e95017fdd8df() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='a9d7062f8f7640d0acf8e95017fdd8df ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' a9d7062f8f7640d0acf8e95017fdd8df';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2013 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_a9d7062f8f7640d0acf8e95017fdd8df()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2013a<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2013a<br><\/p><\/div><!--\r\na9d7062f8f7640d0acf8e95017fdd8df ##### SOURCE BEGIN #####\r\n%% Homomorphic Filtering - Part 2\r\n% _I'd like to welcome back guest blogger Spandan Tiwari for the second post in his\r\n% two-part series on homomorphic filtering._\r\n% \r\n% <https:\/\/blogs.mathworks.com\/steve\/2013\/06\/25\/homomorphic-filtering-part-1\/ \r\n% Last time> we looked at how to apply a simple homomorphic filter. Today we\r\n% continue our discussion on homomorphic filtering. First I'll load the\r\n% variables |I|, |H|, and |Ihmf| that I computed last time.\r\n\r\nload homomorphic_part1\r\n\r\n%%\r\n% In homomorphic filtering we apply a high-pass filter to the\r\n% log-transformed image. The high-pass filtering step provides us with an\r\n% opportunity to simultaneously apply other enhancements to the image.\r\n% Consider a modified version of the high-pass filter $H(u,v)$ that we used\r\n% last time.\r\n% \r\n% $$ H_{e}(u,v) = \\alpha + \\beta \\ H(u,v) $$\r\n% \r\n% We added an offset and a scaling factor for the Gaussian high-pass\r\n% filter. If $\\alpha < 1$ and $\\beta > 1$, this filter will amplify the\r\n% high-frequency components more than the low-frequency components. This\r\n% filter is called _high-frequency emphasis_ filter. The resulting image,\r\n% typically, is sharper and also has better contrast. We choose $\\alpha =\r\n% 0.5$ and $\\beta = 1.5$, and formulate the high-frequency emphasis filter.\r\n\r\nalpha = 0.5; \r\nbeta = 1.5;\r\nHemphasis = alpha + beta*H;\r\n\r\n%%\r\n% Let's compare the original high-pass filter and the high-frequency\r\n% emphasis filter by looking at their cross-sections. \r\n\r\nplot(1:30,H(1,1:30),'r',1:30,Hemphasis(1,1:30),'b','LineWidth',2);\r\ngrid on; \r\nlegend('High-pass Filter','High-frequency Emphasis Filter','Location','best');\r\n\r\n%%\r\n% Now let's apply the filter and look at the result of homomorphic\r\n% filtering. The image below shows the original (on the left) and the\r\n% homomorphic filtered (on the right) images together. If you compare the\r\n% two images you can see that the gradual change in illumination in the\r\n% left image has been corrected to a large extent in the image on the\r\n% right.\r\n\r\nIf = fft2(I, M, N);\r\nIout = real(ifft2(Hemphasis.*If));\r\nIout = Iout(1:size(I,1),1:size(I,2));\r\n\r\nIhmf_2 = exp(Iout) - 1;\r\n\r\nimshowpair(I, Ihmf_2, 'montage')\r\n\r\n%% \r\n% The non-uniform illumination has largely been corrected. Now let's\r\n% compare our earlier result of homomorphic filtering with regular\r\n% high-pass filter (below, left) and the result with high-frequency\r\n% emphasis filter (below, right). We see that the latter seems to have\r\n% better non-uniform illumination compensation of the two.\r\n\r\nimshowpair(Ihmf, Ihmf_2, 'montage')\r\n\r\n%%\r\n% Also, looking at these two images side-by-side highlights an interesting\r\n% effect. In the image on the left there seems to be a bright _halo type_\r\n% artifact on the borders. This can be seen more clearly if we increase the\r\n% contrast by applying histogram equalization on the image on the left\r\n% using the <https:\/\/www.mathworks.com\/help\/images\/ref\/histeq.html histeq>\r\n% function. Note that I am normalizing the image using\r\n% <https:\/\/www.mathworks.com\/help\/images\/ref\/mat2gray.html mat2gray> before\r\n% passing it to |histeq|.\r\n\r\nimshow(histeq(mat2gray(Ihmf)))\r\n\r\n%%\r\n% The halos on the borders can be seen clearly now. But if you look closely\r\n% it is not just the image on the left that has the halo effect on the\r\n% borders. The output from the high-frequency\r\n% emphasis filter (image on the right) also has a similar, but\r\n% less-pronounced, halo effect. Let's look at the\r\n% histogram equalized version of both these images together to make this\r\n% more apparent.\r\n\r\nimshowpair(histeq(mat2gray(Ihmf)), histeq(mat2gray(Ihmf_2)), 'montage')\r\n\r\n%%\r\n% So why does this happen? Well, this artifact is because we padded the\r\n% image with zeros during filtering, and the effect of the zeros _leak_\r\n% into the image domain. A solution would be to apply a windowing function\r\n% (such as the Hanning window) instead of zero-padding, before computing\r\n% the Discrete Fourier Transform. But this solution is not appropriate\r\n% in our situation because it is the same as introducing another\r\n% slowly-varying multiplicative  _undesired_ signal, just like the\r\n% non-uniform illumination signal that we are trying to remove. Another way\r\n% to help the situation is to pad the image by replicating the intensity at\r\n% the borders of the image instead of padding the image with zeros.\r\n% Although this won't eliminate the artifacts due to _leakage_ completely,\r\n% it will mitigate their severity. To achieve the _replicate_ style\r\n% padding, we will have to pad the image ourselves, instead of letting\r\n% |fft2| pad it for us. We will use Image Processing Toolbox function\r\n% <https:\/\/www.mathworks.com\/help\/images\/ref\/padarray.html padarray> for\r\n% this.\r\n\r\n\r\npaddedI = padarray(I,ceil(size(I)\/2)+1,'replicate');\r\npaddedI = paddedI(1:end-1,1:end-1);\r\n\r\n%%\r\n% Let's look at the result with the _replicate_ style padding. I will show\r\n% the results only for the high-frequency emphasis filter. We apply the\r\n% high-frequency emphasis filter to the padded image.\r\n\r\nIf = fft2(paddedI);\r\nIout = real(ifft2(Hemphasis.*If));\r\n\r\n%% \r\n% Note that we padded the image on both sides in each dimension. This is\r\n% unlike |fft2| which appends trailing zeros along each dimension.\r\n% Consequently, the output will also be padded on both sides.\r\n\r\nimshow(Iout)\r\n\r\n%%\r\n% While cropping the image back to the original size we have to mindful of\r\n% this and crop the image around the center of the larger output image.\r\n\r\nIout = Iout(ceil(M\/2)-size(I,1)\/2+1:ceil(M\/2)+size(I,1)\/2, ...\r\n            ceil(N\/2)-size(I,2)\/2+1:ceil(N\/2)+size(I,2)\/2);\r\n        \r\n%%\r\n% Let's apply the exponential and look at the result. The image on the left\r\n% is the output with zero padding that we computed earlier. The one of the\r\n% right is the output with _replicate_ style padding. We can  see that the\r\n% halo effect has been mitigated to a large extent. \r\n\r\nIhmf_3 = exp(Iout) - 1;\r\nimshowpair(Ihmf_2, Ihmf_3, 'montage')\r\n\r\n%%\r\n% Let's use histogram equalization to get a better a better look. \r\nimshowpair(histeq(mat2gray(Ihmf_2)), histeq(mat2gray(Ihmf_3)), 'montage')\r\n\r\n%%\r\n% The halo effect at the border has been mitigated significantly. But we\r\n% had to do some code mechanics to get homomorphic filtering to play well\r\n% in the FFT-domain. This is where the spatial domain filtering might offer\r\n% a better alternative. It is relatively simpler to do the _replicate_\r\n% style padding in the spatial domain. Let's create a simple spatial domain\r\n% high-pass filter. Although we can create a spatial kernel exactly\r\n% equivalent to the frequency-domain Gaussian high-pass filter we used\r\n% earlier, we won't get into that to keep things simple. Here we make a\r\n% simple ideal high-pass filter.\r\n\r\nfilterRadius = sigma; \r\nfilterSize = 2*filterRadius + 1;\r\nhLowpass = fspecial('average', filterSize);\r\nhImpulse = zeros(filterSize);\r\nhImpulse(filterRadius+1,filterRadius+1) = 1;\r\nhHighpass = hImpulse - hLowpass;\r\n\r\n%% \r\n% Now we apply this high-pass filter in the spatial domain. To get the\r\n% _replicate_ style padding, we simply specify the |'replicate'| option in\r\n% <https:\/\/www.mathworks.com\/help\/images\/ref\/imfilter.html imfilter>. Then\r\n% we apply the exponential to get the homomorphic filtered image.\r\n\r\nIhmf_spatial = imfilter(I, hHighpass, 'replicate');\r\n\r\nIhmf_spatial = exp(Ihmf_spatial) - 1;\r\n\r\n%%\r\n% Here's the filtered image (right) juxtaposed with the original input\r\n% image (left).\r\n\r\nimshowpair(I, Ihmf_spatial, 'montage')\r\n\r\n%% \r\n% Again, we see that the non-uniform illumination has been corrected to a\r\n% large extent and there aren't any noticeable border artifacts. To show\r\n% the absence of the border artifacts let's look at the histogram equalized\r\n% version of the output. For comparison we will also enhance the output\r\n% from frequency-domain high-emphasis filtered image (with zero-padding),\r\n% which is shown on the left. Again, we can see that there aren't any\r\n% noticeable border artifacts after filtering in the spatial domain (image\r\n% on the right).\r\n\r\nimshowpair(histeq(mat2gray(Ihmf_2)), histeq(mat2gray(Ihmf_spatial)), 'montage');\r\n\r\n%%\r\n% Both frequency domain and spatial domain filtering offer some practical\r\n% advantages of their own. Spatial domain filtering offers a\r\n% straightforward way to get the padding right. Also, it might be faster\r\n% for small kernel sizes. But the frequency domain offers an easier and\r\n% more intuitive way to get the filter with desired frequency\r\n% characteristics.\r\n% \r\n% In conclusion, homomorphic filtering is a useful tool to have in your\r\n% quiver of enhancement techniques. It may not be applicable as a generic\r\n% enhancement technique, but it works well on a certain set of problems.\r\n% \r\n% Which applications have you used homomorphic filtering for? Were there\r\n% any specific problems you faced while using it? Let us know. \r\n\r\n##### SOURCE END ##### a9d7062f8f7640d0acf8e95017fdd8df\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/HomomorphicFiltering_Post2_10.jpg\" onError=\"this.style.display ='none';\" \/><\/div><p>I'd like to welcome back guest blogger Spandan Tiwari for the second post in his two-part series on homomorphic filtering.Last time we looked at how to apply a simple homomorphic filter. Today we... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2013\/07\/10\/homomorphic-filtering-part-2\/\">read more >><\/a><\/p>","protected":false},"author":42,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[539,508,392,292,70,943,394,370,867,92,362,372,344,68,200,190,130],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/856"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/comments?post=856"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/856\/revisions"}],"predecessor-version":[{"id":860,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/856\/revisions\/860"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}