# How to use the ButterworthFilterModel to processing image

In the book of "Digital_Image_Processing_3rd" point out this: the 4.57a,4.57b,4.57c is like follow: So I do it according to the direction to:

ft = ButterworthFilterModel[{"Highpass", 4, 50}];
RecurrenceFilter[ToDiscreteTimeModel[ft, 1], pic]


but it failure to get 4.57b,Then I search and try to use the filtfilt:

ft=ButterworthFilterModel[{"Highpass",4,50}];
forwards=RecurrenceFilter[ToDiscreteTimeModel[ft,1],pic//ImageData];
backwards=RecurrenceFilter[ToDiscreteTimeModel[ft,1],Reverse[pic//ImageData]];
forwards+Reverse[backwards]


It failure,too.the oringinal 4.57a is follow pictrue.How can I get the 4.57b and 4.57c.I'm a filter newbie,I'm look forward to your directory. Here's one way using Mathematica's built in filters (rather than trying to do the "recurrence filter" dance using Butterworth).

pic = Import["http://i.stack.imgur.com/mcEp0.png"];
Binarize[HighpassFilter[pic, 0.1]] You may wonder about the filter parameter 0.1. The book had specified a cutoff frequency of "50". Since your image is about 1000 pixels square, the Nyquist frequency is half that (500 oscillations across the image). "50" is about 1/10 of this normalized frequency (Mathematica normalizes the range from DC to the Nyquist rate as between 0 and Pi). This suggests a cutoff of Pi/10 ~ 0.31 -- I preferred the look of 0.1, but it's easy to change. Hence, if you really want to use the antiquated Butterworth filter, you will need to change the specs to something like: {"Highpass", 10, 0.1}. The 50 makes no sense since the frequency needs to be normalized to the range between 0 and Pi. (Thanks to Alexy Popkov for finding the correct normalization constant).

• On the Documentation page for HighpassFilter under the "Properties & Relations" section an example with second argument equal to Pi is given: "Use cutoff frequency of π or greater returns a zero sequence: HighpassFilter[{0, 0, 0, 0, 1, 1, 1, 1}, Pi]." I would interpret this statement in the sense that maximum cutoff frequency is actually equal to π. Sep 27 '15 at 13:30
• @Alexy Popkov -- thanks -- good catch. I've changed the discussion to reflect the correct normalization. Sep 27 '15 at 14:28
• Thank you for such a detailed answer.^_^
– yode
Sep 27 '15 at 21:28