📄 geometric image manipulation.htm
字号:
vertical resampling.
<P></P>
<TR vAlign=top>
<TD>
<P></P>
<TD><CODE>width</CODE>
<P></P>
<TD>The width of a horizontal resampling kernel.
<P></P>
<TR vAlign=top>
<TD>
<P></P>
<TD><CODE>height</CODE>
<P></P>
<TD>The height of a vertical resampling kernel. Ignored if
<CODE>dataV</CODE> is null.
<P></P>
<TR vAlign=top>
<TD>
<P></P>
<TD><CODE>subsample-BitsH</CODE>
<P></P>
<TD>The log<SUB>2</SUB> of the number of horizontal subsample bins.
<P></P>
<TR vAlign=top>
<TD>
<P></P>
<TD><CODE>subsample-BitsV</CODE>
<P></P>
<TD>The log<SUB>2</SUB> of the number of vertical subsample bins.
Ignored if <CODE>dataV</CODE> is null.
<P></P>
<TR vAlign=top>
<TD>
<P></P>
<TD><CODE>precision-Bits</CODE>
<P></P>
<TD>The number of bits of fractional precision to be used when
resampling integral sample values. The same value is used for both
horizontal and vertical resampling.
<P></P>
<TR vAlign=top>
<TD>
<P></P>
<TD><CODE>dataH</CODE>
<P></P>
<TD>The horizontal table entries, as a float array of
2<SUP>subsampleBitsH</SUP> entries each of length <CODE>width</CODE>.
<P></P>
<TR vAlign=top>
<TD>
<P></P>
<TD><CODE>dataV</CODE>
<P></P>
<TD>The vertical table entries, as a float array of
2<SUP>subsampleBitsV</SUP> entries each of length <CODE>height</CODE>,
or null. If null, the <CODE>dataH</CODE> table is used for vertical
interpolation as well and the <CODE>topPadding</CODE>,
<CODE>height</CODE>, and <CODE>subsampleBitsV</CODE> parameters are
ignored.
<P></P></TR></TBODY></TABLE></A>
<P></P></DD></DL><PRE><UL>
<LI>InterpolationTable(int leftPadding, int topPadding, int width,
int height, int subsampleBitsH, int subsampleBitsV,
int precisionBits, double[] dataH, double[] dataV)
<P></P></LI></UL></PRE>
<DL><A name=71012>
<DT>
<DD>constructs an <CODE>InterpolationTable</CODE> with specified horizontal
and vertical extents (support), number of horizontal and vertical bins,
fixed-point fractional precision, and kernel entries. </A>
<P></P></DD></DL><PRE><UL>
<LI>InterpolationTable(int leftPadding, int topPadding, int width,
int height, int subsampleBitsH, int subsampleBitsV,
int precisionBits, int[] dataH, int[] dataV)
<P></P></LI></UL></PRE>
<DL><A name=73497>
<DT>
<DD>constructs an InterpolationTable with specified horizontal and vertical
extents (support), number of horizontal and vertical bins, fixed-point
fractional precision, and int kernel entries. </A>
<P></P></DD></DL><A name=71057>
<H4>8.2.5.6 <IMG src="Geometric Image Manipulation.files/space.gif">Additional
Interpolation Table-related Methods</H4></A>The
<CODE>InterpolationTable</CODE> class provides several methods for retrieving
an interpolation table's kernel data values, subsample size, and precision.
<P>
<TABLE border=0>
<TBODY>
<TR>
<TD><IMG src="Geometric Image Manipulation.files/cistine.gif"></TD>
<TD>
<HR>
<B>API:</B> <CODE>javax.media.jai.InterpolationTable </CODE>
<HR>
</TD></TR></TBODY></TABLE><PRE><UL>
<LI>int getSubsampleBitsH()
<P></P></LI></UL></PRE>
<DL><A name=71075>
<DT>
<DD>returns the number of bits used to index subsample positions in the
horizontal direction. </A>
<P></P></DD></DL><PRE><UL>
<LI>int getSubsampleBitsV()
<P></P></LI></UL></PRE>
<DL><A name=71105>
<DT>
<DD>returns the number of bits used to index subsample positions in the
vertical direction. </A>
<P></P></DD></DL><PRE><UL>
<LI>int getPrecisionBits()
<P></P></LI></UL></PRE>
<DL><A name=71132>
<DT>
<DD>returns the number of bits of fractional precision used to store the
fixed-point table entries. </A>
<P></P></DD></DL><PRE><UL>
<LI>int getLeftPadding()
<P></P></LI></UL></PRE>
<DL><A name=71148>
<DT>
<DD>returns the number of bits of fractional precision used to store the
fixed-point table entries. </A>
<P></P></DD></DL><PRE><UL>
<LI>int getTopPadding()
<P></P></LI></UL></PRE>
<DL><A name=71163>
<DT>
<DD>returns the number of samples required above the center. </A>
<P></P></DD></DL><PRE><UL>
<LI>int getWidth()
<P></P></LI></UL></PRE>
<DL><A name=71173>
<DT>
<DD>returns the number of samples required for horizontal resampling. </A>
<P></P></DD></DL><PRE><UL>
<LI>int getHeight()
<P></P></LI></UL></PRE>
<DL><A name=71187>
<DT>
<DD>returns the number of samples required for vertical resampling. </A>
<P></P></DD></DL><PRE><UL>
<LI>int[] getHorizontalTableData()
<P></P></LI></UL></PRE>
<DL><A name=71199>
<DT>
<DD>returns the integer (fixed-point) horizontal table data. </A>
<P></P></DD></DL><PRE><UL>
<LI>int[] getVerticalTableData()
<P></P></LI></UL></PRE>
<DL><A name=71227>
<DT>
<DD>returns the integer (fixed-point) vertical table data. </A>
<P></P></DD></DL><PRE><UL>
<LI>float[] getHorizontalTableDataFloat()
<P></P></LI></UL></PRE>
<DL><A name=71243>
<DT>
<DD>returns the floating-point horizontal table data. </A>
<P></P></DD></DL><PRE><UL>
<LI>float[] getVerticalTableDataFloat()
<P></P></LI></UL></PRE>
<DL><A name=71257>
<DT>
<DD>returns the floating-point vertical table data. </A>
<P></P></DD></DL><PRE><UL>
<LI>double[] getHorizontalTableDataDouble()
<P></P></LI></UL></PRE>
<DL><A name=71271>
<DT>
<DD>returns the double horizontal table data. </A>
<P></P></DD></DL><PRE><UL>
<LI>double[] getVerticalTableDataDouble()
<P></P></LI></UL></PRE>
<DL><A name=71281>
<DT>
<DD>returns the double vertical table data. </A>
<P></P></DD></DL><A name=56707>
<H2>8.3 <IMG src="Geometric Image Manipulation.files/space.gif">Geometric
Transformation</H2></A>Geometric transformations provide the ability to
reposition pixels within an image. Pixels may be relocated from their
(<EM>x</EM>,<EM>y</EM>) spatial coordinates in the source image to new
coordinates in the destination. Geometric transformations are used, for
example, to move (translate), rotate, and scale the geometry of an image. A
general type of geometric transformation, warp, is discussed later in this
chapter (see <A
href="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Geom-image-manip.doc.html#53798">Section
8.7, "Warping</A>").
<P>Geometric transformations are used to register multiple images, correct
geometric distortions introduced in the image acquisition process, or to add
visual effects. The geometric transformation operations discussed here
include:
<P>
<UL>
<LI>Translation (<CODE>Translate</CODE>) - moves an image up, down, left, or
right
<P></P></LI></UL>
<UL>
<LI>Scaling (<CODE>Scale</CODE>) - enlarges or shrinks an image
<P></P></LI></UL>
<UL>
<LI>Rotation (<CODE>Rotate</CODE>) - rotates an image about a given point
<P></P></LI></UL>
<UL>
<LI>Affine (<CODE>Affine</CODE>) - includes translation, scaling, and
rotation in one operation
<P></P></LI></UL>All transformation operations are performed by moving pixel
values from their original spatial coordinates to new coordinates in the
destination image. Every pixel in the source image is passed through this
transformation, creating a geometrically-transformed output pixel location.
Each pixel of the source image is transformed, pixel by pixel, to its new
location in the destination image.
<P>With a very few exceptions, all transformations result in some output pixel
locations being missed because no input pixels were transformed there. The
missed locations will be devoid of any pixel values and result in a black hole
in the destination image. To overcome this problem, intermediate pixel values
are estimated through interpolation (See <A
href="http://java.sun.com/products/java-media/jai/forDevelopers/jai1_0_1guide-unc/Geom-image-manip.doc.html#51290">"Interpolation"
on page 249</A>). One of four <CODE>interpolation</CODE> methods may be
selected:
<P>
<TABLE cellPadding=3 border=3>
<CAPTION><FONT size=-1><B></B></FONT></CAPTION>
<TBODY>
<TR vAlign=top>
<TH><A name=64125>interpolation Methods </A>
<TH><A name=64127>Description </A>
<TR vAlign=top>
<TD><A name=64129>INTERP_NEAREST</A><BR>
<TD><A name=64131>Use nearest-neighbor interpolation</A><BR>
<TR vAlign=top>
<TD><A name=64133>INTERP_BILINEAR</A><BR>
<TD><A name=64135>Use bilinear interpolation</A><BR>
<TR vAlign=top>
<TD><A name=64137>INTERP_BICUBIC</A><BR>
<TD><A name=64139>Use bicubic interpolation</A><BR>
<TR vAlign=top>
<TD><A name=64141>INTERP_BICUBIC2</A><BR>
<TD><A name=64143>Use bicubic2 interpolation (uses a different
polynomial function)</A><BR></TR></TBODY></TABLE>
<P><A name=60866>
<H3>8.3.1 <IMG src="Geometric Image Manipulation.files/space.gif">Translation
Transformation</H3></A>Image translation is the spatial shifting of an image
up, down, left, or right. The relationships between the source and destination
image coordinates are given by the following equation:
<P>
<P><A name=60873>
<UL>
<TABLE>
<TBODY>
<TR>
<TD width=430><IMG
src="Geometric Image Manipulation.files/Geom-image-manip.doc.anc.gif">
</TD>
<TD>(8.1)</TD></TR></TBODY></TABLE></UL></A>
<DL><A name=60874>
<DT>
<DD>where: </A>
<P>
<DL><A name=60875>
<DT>
<DD><EM>x</EM><SUB>D</SUB> and <EM>y</EM><SUB>D</SUB> are the integer
pixel coordinates of the destination image </A>
<P><A name=60876></P>
<DT>
<DD><EM>t</EM><SUB>x</SUB> and <EM>t</EM><SUB>y</SUB> are the translation
values </A>
<P><A name=60877></P>
<DT>
<DD><EM>x</EM>'S and <EM>y</EM>'S denote the source image point from which
the pixel estimate is computed. </A>
<P></P></DD></DL></DD></DL>Translation is often used to register multiple
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -