Class MeasurementRectangle
java.lang.Object
com.flir.thermalsdk.image.measurements.MeasurementShape
com.flir.thermalsdk.image.measurements.MeasurementShapeMovable
com.flir.thermalsdk.image.measurements.MeasurementRectangle
Defines measurement rectangle shape. Allows to measure temperature in rectangular area. It gives
the possibility to find area's minimum, maximum and average temperature. There is functionality
to find the exact location for minimum and maximum values.
Below is an example, how to read and modify the collection containing rectangle measurement tools.
Below is an example, how to read and modify the collection containing rectangle measurement tools.
public class MyMeasurements {
private ThermalImage mImage;
// ... load the image from file or FLIR Thermal camera
public void getRectangleMeasurements() {
MeasurementShapeCollection collection = mImage.getMeasurements();
List<MeasurementRectangle> rectangles = collection.getRectangles();
// use rectangles
}
public void addRectangleMeasurement(int left, int top, int width, int height) {
try {
mImage.getMeasurements().addRectangle(left, top, width, height);
} catch (IllegalArgumentException e) {
// invalid shape coordinates
}
}
}
-
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanintGets the height of the area the rectangle measurement tool covers.booleanbooleanbooleanbooleanGets the location of the area covered by the rectangle measurement tool.Gets the area covered by rectangle measurement tool.intgetWidth()Gets the width of the area the rectangle measurement tool covers.voidMoves the shape to the desired position.voidoffset(int offsetX, int offsetY) Moves the shape byoffsetXon X axis and byoffsetYon Y axis.voidsetAreaCalc(boolean enable) voidsetAvgCalc(boolean enable) voidsetHeight(int height) Sets the new height of the area the rectangle measurement tool covers.voidsetMaxCalc(boolean enable) voidsetMaxMarker(boolean visible) voidsetMinCalc(boolean enable) voidsetMinMarker(boolean visible) voidsetRectangle(@NotNull Rectangle rectangle) Sets the area covered by rectangle measurement tool.voidsetWidth(int width) Sets the new width of the area the rectangle measurement tool covers.toString()
-
Method Details
-
moveTo
Description copied from class:MeasurementShapeMovableMoves the shape to the desired position.- Specified by:
moveToin classMeasurementShapeMovable- Parameters:
point- A point where the shape should be moved to. If not stated otherwise, the point corresponds to top left corner of the shape.- Throws:
MeasurementException- when the shape is invalid (i.e. removed from measurements collection)IllegalArgumentException- when moving to given point causes the shape to be out of image bound (i.e. moving to negative coordinates)
-
offset
Description copied from class:MeasurementShapeMovableMoves the shape byoffsetXon X axis and byoffsetYon Y axis.- Specified by:
offsetin classMeasurementShapeMovable- Parameters:
offsetX- an X axis offset by which the shape will be movedoffsetY- an Y axis offset by which the shape will be moved- Throws:
MeasurementException- when the shape is invalid (i.e. removed from measurements collection)IllegalArgumentException- when moving to given position causes the shape to be out of image bound (i.e. moving to negative coordinates)
-
getWidth
public int getWidth()Gets the width of the area the rectangle measurement tool covers.- Returns:
- the width of the area the rectangle measurement tool covers.
-
setWidth
Sets the new width of the area the rectangle measurement tool covers. The location of top right corner remains unchanged.- Parameters:
width- the width of the tool to set.- Throws:
MeasurementException- when the shape is invalid (i.e. removed from measurements collection)IllegalArgumentException- when width is incorrect (i.e. negative width or causes the shape to be out of image bound)
-
getHeight
public int getHeight()Gets the height of the area the rectangle measurement tool covers.- Returns:
- the height of the area the rectangle measurement tool covers.
-
setHeight
Sets the new height of the area the rectangle measurement tool covers. The location of top right corner remains unchanged. The height is changed only, if provided value is greater than 0.- Parameters:
height- the height of the tool to set.- Throws:
MeasurementException- when the shape is invalid (i.e. removed from measurements collection)IllegalArgumentException- when height is incorrect (i.e. negative height or causes the shape to be out of image bound)
-
getPosition
Gets the location of the area covered by the rectangle measurement tool. This location describes top left corner of the rectangle.- Returns:
- the location of top left corner of the area representing rectangle measurement tool.
-
getRectangle
Gets the area covered by rectangle measurement tool. All measurement's values depend on the area the tool covers.- Returns:
- the area covered by rectangle measurement tool.
-
setRectangle
Sets the area covered by rectangle measurement tool. All measurement's values depend on the area the tool covers. -
getMinMarkerPosition
-
getMinMarker
public boolean getMinMarker() -
setMinMarker
- Throws:
MeasurementException
-
getMaxMarkerPosition
-
getMaxMarker
public boolean getMaxMarker() -
setMaxMarker
- Throws:
MeasurementException
-
getAvgValue
-
getMinValue
-
getMaxValue
-
getAvgCalc
public boolean getAvgCalc() -
setAvgCalc
- Throws:
MeasurementException
-
getMinCalc
public boolean getMinCalc() -
setMinCalc
- Throws:
MeasurementException
-
getMaxCalc
public boolean getMaxCalc() -
setMaxCalc
- Throws:
MeasurementException
-
getAreaDimensions
-
getAreaCalc
public boolean getAreaCalc() -
setAreaCalc
public void setAreaCalc(boolean enable) -
toString
-