Can we generate “foveated Image” in Mathematica

后端 未结 3 1691
刺人心
刺人心 2020-12-28 08:32

\"Foveated imaging is a digital image processing technique in which the image resolution, or amount of detail, varies across the image according to one or more \"fixation po

3条回答
  •  隐瞒了意图╮
    2020-12-28 08:50

    Following on Sjoerd's answer, you can Fold[] a radius-dependent blur as follows.

    A model for the acuity (very rough model):

    Clear[acuity];
    acuity[distance_, x_, y_, blindspotradius_] := 
        With[{\[Theta] = ArcTan[distance, Sqrt[x^2 + y^2]]}, 
           Clip[(Chop@Exp[-Abs[\[Theta]]/(15. Degree)] - .05)/.95, 
                {0,1}] (1. - Boole[(x + 100.)^2 + y^2 <= blindspotradius^2])]
    
    Plot3D[acuity[250., x, y, 25], {x, -256, 256}, {y, -256, 256}, 
           PlotRange -> All, PlotPoints -> 40, ExclusionsStyle -> Automatic]
    

    Acuity of fovea model

    The example image:

    size = 100;
    lena = ImageResize[ExampleData[{"TestImage", "Lena"}], size];
    
    
    Manipulate[
     ImageResize[
       Fold[Function[{ima, r}, 
       ImageFilter[(Mean[Flatten[#]] &), ima, 
          7*(1 - acuity[size*5, r, 0, 0]), 
          Masking -> Graphics[Disk[p/2, r], 
                        PlotRange -> {{0, size}, {0, size}}]
       ]], 
       lena, Range[10, size, 5]], 
     200], 
    {{p, {size, size}}, Locator}]
    

    Some examples:

    Acuity example 1

    Acuity example 2

提交回复
热议问题