High resolution measurements of the depth of the mold for the United States one cent coin provide an interesting data set.
During a visit around 1985 to what was then called the National Bureau of Standards, I was shown an instrument that made high resolution measurements of the thickness of small objects. The instrument would pass a stylus across the object multiple times, recording its height or depth, something like a square phonograph player. My hosts demonstrated the instrument by measuring the depth of a mold obtained from the United States Mint to make a one cent piece, a penny.
The result is a 512-by-512 array of integers in the range from 0 to 255. Back then, graphics on an array that large was beyond the capacity of MATLAB, so I subsampled the data to produce the 128-by-128 array called penny.mat that has been distributed in our demos directory for many years.
Now we can handle the full 512-by-512 array. Here it is, saved as uint8's. If you want to follow along with this blog on your own machine, click on this link, download the array, and convert it to doubles.
load penny512.mat P = double(flipud(P));
The copper colormap is just a linear ramp of rgb values up to a copper color.
set(gcf,'renderer','zbuffer') colormap(copper) rgbplot(copper) title('copper')
Our first view of the data is a surface plot, with lighting and shading. You have to realize this is not a photograph of a penny. It is a top down view of a three-dimensional surface plot of the depth data obtained from the scanning stylus. The placement of the light and calculation of its reflections are critical.
surf(P); shading interp material metal lighting gouraud daspect([1,1,20]) axis tight axis off set(gca,'zlimmode','auto','climmode','manual'); light('pos',[1,1,2000],'style','inf'); view(2)
Zoom in on the date. You can see the striations resulting from the scanning action.
surf(P(50:130,360:490)); shading interp material metal lighting gouraud daspect([1,1,20]) axis tight axis off set(gca,'zlimmode','auto','climmode','manual'); light('pos',[1,1,2000],'style','inf'); view(2)
Now display a contour plot with 20 copper colored contour levels.
contour(P,20) axis square axis off
Here is a closer three dimensional view with tiny points on the surface.
surf(P,'facecolor','none','edgecolor','none',... 'marker','.','markeredgecolor','flat','markersize',1); daspect([1,1,20]) axis tight axis off set(gca,'zlimmode','auto'); camzoom(3);
Thanks to Eric Ludlam and Mike Garrity for help with this post.
要发表评论，请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。