Class MeasurementLine
java.lang.Object
com.flir.thermalsdk.image.measurements.MeasurementShape
com.flir.thermalsdk.image.measurements.MeasurementShapeMovable
com.flir.thermalsdk.image.measurements.MeasurementLine
Defines a line measurement tool shape. The SDK supports only horizontal or vertical lines. This
tool allows to measure temperature in line 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 line measurement tools.
Below is an example, how to read and modify the collection containing line measurement tools.
public class MyMeasurements {
private ThermalImage mImage;
// ... load the image from file or FLIR Thermal camera
public void getLineMeasurements() { MeasurementShapeCollection collection = mImage.getMeasurements(); List<MeasurementLine> lines = collection.getLines(); // use lines }
public void addLineMeasurement(int position, boolean isHorizontal) { try { if(isHorizontal){ mImage.getMeasurements().addHorizontalLine(position); } else { mImage.getMeasurements().addVerticalLine(position); } } catch (IllegalArgumentException e) { // invalid shape coordinates } } }
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
getEnd()
Gets the end point of the line measurement tool.boolean
boolean
boolean
boolean
getStart()
Gets the start point of the line measurement tool.boolean
Checks, if the line measurement tool is horizontal.boolean
Checks, if the line measurement tool is vertical.void
Moves the shape to the desired position.void
offset
(int offsetX, int offsetY) Moves the shape byoffsetX
on X axis and byoffsetY
on Y axis.void
setAreaCalc
(boolean enable) void
setAvgCalc
(boolean enable) void
Set the location (2D coordinate) of the line.void
setMaxCalc
(boolean enable) void
setMaxMarker
(boolean visible) void
setMinCalc
(boolean enable) void
setMinMarker
(boolean visible) toString()
-
Method Details
-
moveTo
Description copied from class:MeasurementShapeMovable
Moves the shape to the desired position.- Specified by:
moveTo
in 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:MeasurementShapeMovable
Moves the shape byoffsetX
on X axis and byoffsetY
on Y axis.- Specified by:
offset
in 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)
-
isHorizontal
public boolean isHorizontal()Checks, if the line measurement tool is horizontal. In general only horizontal and vertical lines covering entire image are supported.- Returns:
true
, if the line representing this measurement tool is horizontal,false
otherwise.
-
isVertical
public boolean isVertical()Checks, if the line measurement tool is vertical. In general only horizontal and vertical lines covering entire image are supported.- Returns:
true
, if the line representing this measurement tool is vertical,false
otherwise.
-
getStart
Gets the start point of the line measurement tool.- Returns:
- the starting point of the line.
-
getEnd
Gets the end point of the line measurement tool.- Returns:
- the end point of the line.
-
setLine
public void setLine(Point posStart, Point posEnd) throws MeasurementException, IllegalArgumentException Set the location (2D coordinate) of the line. Note: Coordinates should be positive values.- Parameters:
posStart
- The start of the line.posEnd
- The end of the line.- Throws:
IllegalArgumentException
- Thrown if the line is invalid/outside the imageMeasurementException
-
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
-