"Fossies" - the Fresh Open Source Software Archive

Member "cloc-1.86/tests/inputs/issues/296/Mathematica_1.m" (19 May 2020, 611 Bytes) of package /linux/privat/cloc-1.86.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Matlab source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 (* http://spot.colorado.edu/~sitelic/samplecode/mathematica/imagesfile.html
    2  *)
    3 
    4 image = Import["denise.png","PNG"]   (* or *)
    5 
    6 image = Import["denise.gif","GIF"]
    7 
    8 A = image[[1,1]]/255.;
    9 ListDensityPlot[A,Mesh->False, AspectRatio->Automatic]
   10 
   11 (*
   12         -- or -- 
   13  *)
   14 
   15 Show[Graphics[Raster[A]], AspectRatio->Automatic]
   16 
   17 
   18 blurA = ListConvolve[Table[1/25,{5},{5}],A];
   19 
   20 Show[Graphics[Raster[blurA]], AspectRatio->Automatic]
   21 B = Fourier[A];
   22 
   23 (*
   24           delete
   25     higher frequencies *)
   26 
   27 B[[Range[30,278],All]]=0;
   28 
   29 B[[All,Range[30,202]]]=0;
   30 
   31 Show[Graphics[Raster[ Re[InverseFourier[B]] ]], AspectRatio->Automatic]