001package javax.visrec.util; 002 003/** 004 * This class represents a bounding box over image at specified position, dimensions, label and score. 005 * 006 * @author Zoran Sevarac 007 * @since 1.0 008 */ 009public class BoundingBox { 010 private int id; 011 private final float x, y, width, height; 012 private final String label; 013 private final float score; 014 015 016 public BoundingBox(String label, float score, int x, int y, float width, float height) { 017 this.label =label; 018 this.score = score; 019 this.x = x; 020 this.y = y; 021 this.width = width; 022 this.height = height; 023 } 024 025 public float getX() { 026 return x; 027 } 028 029 public float getY() { 030 return y; 031 } 032 033 public float getWidth() { 034 return width; 035 } 036 037 public float getHeight() { 038 return height; 039 } 040 041 public int getId() { 042 return id; 043 } 044 045 public void setId(int id) { 046 this.id = id; 047 } 048 049 public float getScore() { 050 return score; 051 } 052 053 public String getLabel() { 054 return label; 055 } 056 057 @Override 058 public String toString() { 059 return "BoundingBox{" + "id=" + id + ", x=" + x + ", y=" + y + ", width=" + width + ", height=" + height + ", label=" + label + ", score=" + score + '}'; 060 } 061 062 063 064}