如何在Mathematica中生成这样的图像

我正在考虑处理一个图像来生成 有以下效果 在Mathematica给予其强大的图像处理能力。 任何人都可以提供一些关于如何做到这一点的想法?

非常感谢。


这是一个使用纹理的版本。 它当然不是一个真正的镜头,只是以重叠的方式重复部分图像。

t = CurrentImage[];

(* square off the image to avoid distortion *)
t = ImageCrop[t, {240,240}];

n = 20; 
Graphics[{Texture[t], 
   Table[
     Polygon[
       Table[h*{Sqrt[3]/2, 0} + (g - h)*{Sqrt[3]/4, 3/4} + {Sin[t], Cos[t]}, 
         {t, 0., 2*Pi - Pi/3, Pi/3}
         ], 
       VertexTextureCoordinates -> Transpose[{
         Rescale[
           (1/4)*Sqrt[3]*(g - h) + (Sqrt[3]*h)/2., 
           {-n/2, n/2}, 
           {0, 1}
           ] + {0, Sqrt[3]/2, Sqrt[3]/2, 0, -(Sqrt[3]/2), -(Sqrt[3]/2)}/(n/2), 
         Rescale[
           (3.*(g - h))/4, 
           {-n/2, n/2}, 
           {0, 1}
           ] + {1, 1/2, -(1/2), -1, -(1/2), 1/2}/(n/2)
         }]
      ], 
      {h, -n, n, 2}, 
      {g, -n, n, 2}
    ]
  }, 
  PlotRange -> n/2 - 1
]

以上代码适用于标准图像测试(Lena)

在这里输入图像描述


“我认为这可以用计算出的每个单元格图像的偏移量来近似计算出来。”--Wizard先生

究竟! 正如您从重建图像中看到的那样,没有镜头效果,而瓷砖只是位移。

你需要的是一个Hexagonal_tesellation和一个简单的算法来计算来自某个选定中心点(weight / 2,height / 2)的每个六边形的位移。

链接地址: http://www.djcxy.com/p/35619.html

上一篇: how to generate such an image in Mathematica

下一篇: Finding frequency of range of numbers in Mathematica