Qia*_* Li 16 wolfram-mathematica image-processing
我正在考虑处理生成的图像
在Mathematica中赋予其强大的图像处理能力.任何人都可以对如何做到这一点有所了解吗?
非常感谢.
Bre*_*ion 15
这是一个版本,使用纹理.它当然不是一个真正的镜头,只是以重叠的方式重复部分图像.
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
]
Run Code Online (Sandbox Code Playgroud)

"我认为这可以用每个单元格中图像的计算偏移量很好地近似"--Wizard先生
究竟!从重建图像中可以看出,没有镜头效果,而瓷砖只是位移.

你需要的是一个Hexagonal_tessellation和一个简单的算法来计算每个六边形从一些选定的中心点(重量/ 2,高度/ 2)的位移.