Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 我们能不能生成;“中心凹图像”;在数学中_Image_Image Processing_Wolfram Mathematica - Fatal编程技术网

Image 我们能不能生成;“中心凹图像”;在数学中

Image 我们能不能生成;“中心凹图像”;在数学中,image,image-processing,wolfram-mathematica,Image,Image Processing,Wolfram Mathematica,是一种数字图像处理技术,其中图像分辨率或细节量在图像中根据一个或多个“固定点”而变化。固定点表示图像的最高分辨率区域,并对应于眼睛视网膜中央凹的中心 我想用这样的图像来说明人类的视力,下面的图表显示了左眼(水平部分)相对于中心凹的相对视力(维基百科): 有没有办法使用Mathematica的图像处理功能在Mathematica中创建中心凹图像?以下内容可能适合您。过滤细节应根据您的喜好进行调整 lena = ExampleData[{"TestImage", "Lena"}] 根据Sj

是一种数字图像处理技术,其中图像分辨率或细节量在图像中根据一个或多个“固定点”而变化。固定点表示图像的最高分辨率区域,并对应于眼睛视网膜中央凹的中心

我想用这样的图像来说明人类的视力,下面的图表显示了左眼(水平部分)相对于中心凹的相对视力(维基百科):


有没有办法使用Mathematica的图像处理功能在Mathematica中创建中心凹图像?

以下内容可能适合您。过滤细节应根据您的喜好进行调整

lena = ExampleData[{"TestImage", "Lena"}]


根据Sjoerd的答案,您可以
折叠[]
一个半径相关模糊,如下所示

视力模型(非常粗略的模型):

一些例子:


如Mathematica文档所示,小波索引可以提供空间变化的模糊。下面是一个
foveatedBlur
的实现,使用另一个答案中
acuity
函数的编译版本:

Clear[foveatedBlur];
foveatedBlur[image_, d_, cx_, cy_, blindspotradius_] := 
   Module[{sx, sy}, 
      {sy, sx} = ImageDimensions@image;
      InverseWaveletTransform@WaveletMapIndexed[ImageMultiply[#, 
          Image[acuityC[d, sx, sy, -cy + sy/2, cx - sx/2, blindspotradius]]] &, 
          StationaryWaveletTransform[image, Automatic, 6], {___,  1 | 2 | 3 | 4 | 5 | 6}]]
汇编的敏锐度在哪里

Clear[acuityC];
acuityC = Compile[{{distance, _Real}, {sx, _Integer}, {sy, _Integer}, {x0, _Real}, 
                   {y0, _Real}, {blindspotradius, _Real}}, 
            Table[With[{\[Theta] = ArcTan[distance, Sqrt[(x - x0)^2 + (y - y0)^2]]},  
                  (Exp[-Abs[\[Theta]]/(15 Degree)] - .05)/.95 
                  *(1. - Boole[(x - x0)^2 + (y - y0 + 0.25 sy)^2 <= blindspotradius^2])], 
                  {x, Floor[-sx/2], Floor[sx/2 - 1]}, {y, Floor[-sy/2], Floor[sy/2 - 1]}]];


看到盲点了吗?

非常感谢,我觉得这个盲点是你的!Sjoerd,我需要一个2D中眼睛感光细胞密度的好图,比如:你知道这种高质量的图吗?还是一个使用这些并制作更好的游戏的技巧?无论如何,谢谢你的关注@500请注意,此技术仅伪造与位置相关的模糊。模糊本身在任何地方都是恒定的,但与位置相关的alpha混合在一起。至少我认为
掩蔽
就是这样工作的。因此,我认为尝试制作非常精确的密度图是不值得的,因为它们不能真正用于用这种方法精确表示视力。你需要的是一个位置相关的过滤器,我在mma的图像处理功能集中还没有找到。我认为自己编写一个程序并不太困难。会慢一点。非常感谢!定位器太可爱了!谢谢你的排版修正,Sjoerd。非常聪明的扩展!我是否错误地认为外部区域多次模糊?这难道不会比敏锐度更模糊吗?也许可以调整敏锐度功能来纠正这一点?顺便说一句,{“TestImage”,“ResolutionChart”}也可以得到一个很好的测试图像;如果您在中向外工作,即将范围[10,size,5]替换为范围[size,10,-5],则不太明显。但是它确实需要考虑。或者,Sjoerd,我们可以使用环形掩模,这样就没有重叠。我认为基本技术与ImageFilter有足够的不同,可以证明它自己的答案。
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]
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}]
Clear[foveatedBlur];
foveatedBlur[image_, d_, cx_, cy_, blindspotradius_] := 
   Module[{sx, sy}, 
      {sy, sx} = ImageDimensions@image;
      InverseWaveletTransform@WaveletMapIndexed[ImageMultiply[#, 
          Image[acuityC[d, sx, sy, -cy + sy/2, cx - sx/2, blindspotradius]]] &, 
          StationaryWaveletTransform[image, Automatic, 6], {___,  1 | 2 | 3 | 4 | 5 | 6}]]
Clear[acuityC];
acuityC = Compile[{{distance, _Real}, {sx, _Integer}, {sy, _Integer}, {x0, _Real}, 
                   {y0, _Real}, {blindspotradius, _Real}}, 
            Table[With[{\[Theta] = ArcTan[distance, Sqrt[(x - x0)^2 + (y - y0)^2]]},  
                  (Exp[-Abs[\[Theta]]/(15 Degree)] - .05)/.95 
                  *(1. - Boole[(x - x0)^2 + (y - y0 + 0.25 sy)^2 <= blindspotradius^2])], 
                  {x, Floor[-sx/2], Floor[sx/2 - 1]}, {y, Floor[-sy/2], Floor[sy/2 - 1]}]];
size = 256;
lena = ImageResize[ExampleData[{"TestImage", "Lena"}], size];

Manipulate[foveatedBlur[lena, d, p[[1]], p[[2]], 20], {{d, 250}, 50, 
    500}, {{p, ImageDimensions@lena/2}, Locator, Appearance -> None}]