类 BoundBox
- java.lang.Object
-
- cc.chungkwong.mathocr.common.BoundBox
-
public class BoundBox extends Object
Bounding box- 作者:
- Chan Chung Kwong
-
-
构造器概要
构造器 构造器 说明 BoundBox(int left, int right, int top, int bottom)Create a bounding box
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 booleancontains(int x, int y)Check if a point is in the boxbooleanequals(Object obj)intgetArea()intgetBottom()intgetHeight()intgetLeft()intgetRight()intgetTop()intgetWidth()inthashCode()static BoundBoxintersect(BoundBox a, BoundBox b)Get the intersection of two bounding boxesBoundBoxscale(double factor)Zoom this boxStringtoString()static BoundBoxunion(BoundBox a, BoundBox b)Get the smallest box that contains two bounding boxesstatic BoundBoxunion(Iterator<BoundBox> box)Get the smallest box that contains all given bounding boxes
-
-
-
方法详细资料
-
getLeft
public int getLeft()
- 返回:
- min X
-
getRight
public int getRight()
- 返回:
- max X
-
getTop
public int getTop()
- 返回:
- min Y
-
getBottom
public int getBottom()
- 返回:
- max Y
-
getWidth
public int getWidth()
- 返回:
- width
-
getHeight
public int getHeight()
- 返回:
- height
-
getArea
public int getArea()
- 返回:
- area
-
contains
public boolean contains(int x, int y)Check if a point is in the box- 参数:
x- x coordinatey- y coordinate- 返回:
-
scale
public BoundBox scale(double factor)
Zoom this box- 参数:
factor- the scale- 返回:
- new bounding box
-
intersect
public static BoundBox intersect(BoundBox a, BoundBox b)
Get the intersection of two bounding boxes- 参数:
a- a bounding boxb- another bounding box- 返回:
- intersection
-
union
public static BoundBox union(BoundBox a, BoundBox b)
Get the smallest box that contains two bounding boxes- 参数:
a- a bounding boxb- another bounding box- 返回:
- the smallest box that contains them
-
union
public static BoundBox union(Iterator<BoundBox> box)
Get the smallest box that contains all given bounding boxes- 参数:
box- given bounding boxes- 返回:
- the smallest box that contains them
-
-