MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Wavelet and histogram

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115886] Re: Wavelet and histogram
  • From: "Vivek J. Joshi" <vivekj at wolfram.com>
  • Date: Mon, 24 Jan 2011 05:23:01 -0500 (EST)

Hi,

Following is an example demonstrating how you can do this,

img == ExampleData[{"TestImage","Lena"}];

dwd == DiscreteWaveletTransform[img,DaubechiesWavelet[],3];

(* Extract wavelet Coefficients as Images and use ImageHistogram *)

Map[Part[#,1]->ImageHistogram[Part[#,2],Appearance-> "Stacked",ImageSize->2=
50,FrameTicks->Automatic]&,dwd[{_},"Image"]]

(* When using data form "Image" (as above) the Image coefficients have resc=
aled coefficient values (ImageAdjust[ImageApply[Abs,#]]&), Use ImageFunctio=
n->Identity to get "Actual  Coefficient Values" *)

Map[Part[#,1]->ImageHistogram[Part[#,2],128,{-1,3},Appearance-> "Stacked",I=
mageSize->250,
FrameTicks->Automatic]&,dwd[{_},{"Image","ImageFunction"->Identity}]]

Taking a closer look at Min and Max values in each color channel,

Map[Part[#,1]->Map[{Min[Flatten[#]],Max[Flatten[#]]}&,Part[#,2]]&,dwd[{_}]]
{{0}->{{0.418884,2.02185},{-0.0239956,1.97373},{0.354499,1.68462}},
{1}->{{-0.292708,0.330631},{-0.439238,0.488894},{-0.400646,0.466974}},
{2}->{{-0.155326,0.279582},{-0.209463,0.281751},{-0.456572,0.345923}},
{3}->{{-0.112058,0.118638},{-0.149901,0.171185},{-0.279204,0.20271}}}

You can also use Histogram in place of ImageHistogram,

Map[Part[#,1]->Histogram[Map[Flatten,Part[#,2]],{0.02},ImageSize->250,Chart=
Layout->"Stacked",
ChartBaseStyle->EdgeForm[None],ChartStyle->{Red,Green,Blue},PlotRange->{{-1=
,3},Automatic}]&,dwd[{_}]]

Hope this helps.

Thanks,

Vivek J. Joshi
Kernel Developer
Wolfram Research, Inc.


On Jan 23, 2011, at 4:04 PM, Robert Pigeon wrote:

> Hello all,
>
>                Let say i have a image that I defined using img == pasted
> pictured. Then I do a wavelet transfom:
>
> dwd ==  DiscreteWaveletTransform[img,DaubechiesWavelet[],3]. Now I can us=
e
> WaveletImagePlot[dwd] to look at the wavelet levels. I would like to do a=
n
> histogram on all or some level of dwd. I can't find how to do it. I looke=
d
> at  WaveletMapIndexed, but I cant figure out how to do it....
>
>
>
> Any help will be appreciated.
>
>
>
> Thanks
>
> Robert


  • Prev by Date: Re: Simple n-tuple problem - with no simple solution
  • Next by Date: Re: Mathematica 20x slower than Java at arithmetic/special functions, is
  • Previous by thread: Wavelet and histogram
  • Next by thread: Re: Plot works in Mathematca 7 but not in Mathematica 8 [CORRECTION]