pointimageworld.java

来自「camra calibration and you will enjoy it!」· Java 代码 · 共 106 行

JAVA
106
字号
/* * PointImageWorld.java */package itesm.gvision.apps.calibrator;import java.awt.geom.*;import java.text.*;//----------------------------------------------------------------------------------/** * Join an image point with a real world point * @author  hugo */public class PointImageWorld {	private Point2D imagePoint = new Point2D.Double();		private Point2D worldPoint = new Point2D.Double();		private DecimalFormat fmt = new DecimalFormat("0.000");		//----------------------------------------------------------------------------------	/** Creates a new instance of PointImageWorld */	public PointImageWorld(double ix, double iy, double wx, double wy) 	{		this.imagePoint.setLocation(ix, iy);		this.worldPoint.setLocation(wx, wy);	}		//----------------------------------------------------------------------------------	/**	 */	 public void setImagePoint(double x, double y)	 {		 this.imagePoint.setLocation(x, y);	 }	 	//----------------------------------------------------------------------------------	/**	 */	public void setWorldPoint(double x, double y)	{		this.worldPoint.setLocation(x, y);	}	 	//----------------------------------------------------------------------------------	/**	 */	 public double getImageX()	 {		 return this.imagePoint.getX();	 }	 	//----------------------------------------------------------------------------------	/**	 */	 public double getImageY()	 {		 return this.imagePoint.getY();	 }		//----------------------------------------------------------------------------------	/**	 */	 public double getWorldX()	 {		 return this.worldPoint.getX();	 }	 	//----------------------------------------------------------------------------------	/**	 */	 public double getWorldY()	 {		 return this.worldPoint.getY();	 }	//----------------------------------------------------------------------------------	/**	 */	 public Point2D getImagePoint()	 {		 return this.imagePoint;	 }	 	//----------------------------------------------------------------------------------	/**	 */	public Point2D getWorldPoint()	{		return this.worldPoint;	}	 	 //----------------------------------------------------------------------------------	/**	 */	public String toString() 	{		return "(" + fmt.format(this.imagePoint.getX()) + ", " + fmt.format(this.imagePoint.getY()) + ") ==> (" 		           + fmt.format(this.worldPoint.getX()) + ", " + fmt.format(this.worldPoint.getY()) + ")";	}		}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?