Class ThermalImage
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
ThermalImageFile
ThermalImageFile
should be used for them.-
Method Summary
Modifier and TypeMethodDescriptionaddSketch
(@Nullable JavaImageBuffer sketch) Set the sketch image.void
close()
Closes the image and frees all resources.Gets theCameraInformation
describing the device the image was taken with.Deprecated.Gets aColorDistributionSettings
for the image.Gets a date when the image was taken.@Nullable DisplaySettings
Gets aDisplaySettings
information for the image.Gets aDistanceUnit
used to define any distance parameter related with image.Gets list of Meterlink readings embedded in the image.@Nullable Fusion
Gets aFusion
object set for this image.getImage()
Gets aJavaImageBuffer
object, which represents an image's colorized pixels data depending on selectedFusionMode
.Gets anImageParameters
object for this instance.@NotNull IsothermCollection
Gets a collection ofIsotherm
readings embedded in the image.Gets aMeasurementShapeCollection
set for the image.int
This API exposes what min-radius of the visual indicator of a spot is.@Nullable Palette
Gets aPalette
object set for this image.@Nullable JavaImageBuffer
getPhoto()
Deprecated.getScale()
Gets aScale
for this image.@Nullable JavaImageBuffer
Get the sketch image.Gets anImageStatistics
object providing the statistics for Thermal data.Gets aTemperatureUnit
theThermalValue
s are in.Gets a COPY of text annotations associated with the image.Gets the time zone offset from UTC (in minutes) where the image was taken.getValueAt
(@NotNull Point location) Gets a temperature value from a point(x,y) in the Thermal Image.double[]
Gets temperature values from a list of points(x,y) in the Thermal Image.double[]
Gets temperature values from a rectangle in the Thermal Image.Gets aVoiceAnnotation
object associated with the image.boolean
Checks whether thisThermalImageFile
contains a validVoiceAnnotation
object.void
Save this object to a file with provided name.void
saveAs
(@NotNull String fileAbsPath, @Nullable JavaImageBuffer overlay) Save current object to a file with provided name.void
setColorDistribution
(ColorDistribution colorDistribution) Deprecated.void
setColorDistributionSettings
(ColorDistributionSettings colorDistributionSettings) Sets aColorDistributionSettings
to define, how colors should be calculated from the thermal data.void
setDisplaySettings
(@NotNull DisplaySettings displaySettings) Sets aDisplaySettings
information for the image.void
setDistanceUnit
(DistanceUnit distanceUnit) Sets aDistanceUnit
used to define any distance parameter related with image.void
setPalette
(Palette palette) Sets aPalette
for the Thermal image defined by this instance.void
setTemperatureUnit
(TemperatureUnit temperatureUnit) Sets aTemperatureUnit
theThermalValue
s are in.void
setTextAnnotations
(List<Pair<String, String>> list) Sets a text annotations associated with the image.void
storeVoiceAnnotation
(byte[] audioData, VoiceAnnotationFormat format) Stores the audio data to theThermalImage
.toString()
Methods inherited from class com.flir.thermalsdk.image.ImageBase
getCompassInformation, getDescription, getGasQuantificationInput, getGasQuantificationResult, getGpsInformation, getHeight, getWidth, rotate, setCompassInformation, setDescription, setGpsInformation
-
Method Details
-
getImage
Description copied from class:ImageBase
Gets aJavaImageBuffer
object, which represents an image's colorized pixels data depending on selectedFusionMode
. Rendered/colorized image, which size, appearance etc. heavily depends on theFusionMode
andColorDistributionSettings
.
Note: raw IR and DC pixels are used to generate this image (depending on fusion mode), and DC image will be aligned even inFusionMode.VISUAL_ONLY
mode.- Specified by:
getImage
in classImageBase
- Returns:
- an image buffer as a
JavaImageBuffer
containing image's colorized pixels data depending on selectedFusionMode
. - See Also:
-
getPhoto
Deprecated.Gets a visual image (photo) as aJavaImageBuffer
extracted from the file. This is a full resolution photo that is not fusion aligned.- Returns:
- a visual image (photo) as a
JavaImageBuffer
extracted from the file ornull
, if no visual image is associated with this file.
-
getColorDistribution
Deprecated.UsegetColorDistributionSettings()
instead.Gets aColorDistribution
mode for the image. The mode depends on the Thermal camera's capabilities.- Returns:
- a
ColorDistribution
mode.
-
setColorDistribution
Deprecated.Sets aColorDistribution
mode to define, how colors should be calculated from Thermal data. The mode depends on the Thermal camera's capabilities and should be set based on them.- Parameters:
colorDistribution
- a newColorDistribution
mode.
-
getColorDistributionSettings
Gets aColorDistributionSettings
for the image. -
setColorDistributionSettings
Sets aColorDistributionSettings
to define, how colors should be calculated from the thermal data.- Parameters:
colorDistributionSettings
- a newColorDistributionSettings
.
-
getDistanceUnit
Gets aDistanceUnit
used to define any distance parameter related with image.- Returns:
- the
DistanceUnit
defining any distance parameter. - See Also:
-
setDistanceUnit
Sets aDistanceUnit
used to define any distance parameter related with image. It is applied to theImageParameters
's definition of a distance to the object.- Parameters:
distanceUnit
- a newDistanceUnit
to be used.- See Also:
-
getTemperatureUnit
Gets aTemperatureUnit
theThermalValue
s are in. It is applied to all values obtained from the image orMeasurementShape
s associated with it.- Returns:
- a
TemperatureUnit
used to defineThermalValue
s.
-
setTemperatureUnit
Sets aTemperatureUnit
theThermalValue
s are in. It is applied to all values obtained from the image orMeasurementShape
s associated with it.- Parameters:
temperatureUnit
- a newTemperatureUnit
to be used.
-
getDateTaken
Gets a date when the image was taken.- Returns:
- a date when the image was taken as a Java
Date
object or null if date can't be retrieved. - See Also:
-
getTimeZoneTakenOffset
Gets the time zone offset from UTC (in minutes) where the image was taken.
Example 1: If the camera was configured for Central European time (CET/CEST) this function will return +2h if the image was taken during summer (daylight saving on), and +1h if the image was taken during winter (daylight saving off).
Example 2: If the camera was configured for West Africa time (WAT) it'll always return +1h since West Africa doesn't use daylight saving.- Returns:
- The time zone offset in minutes, or null if the time zone information is unavailable.
- See Also:
-
getMeasurements
Gets aMeasurementShapeCollection
set for the image. It contains allMeasurementShape
s added and attached to the image. Each measurement in the collection can provide information about temperature measured in the area it covers.- Returns:
- a
MeasurementShapeCollection
set for the image.
-
getDisplaySettings
Gets aDisplaySettings
information for the image. The DisplaySettings reflects how the image was displayed in the application or camera UI. -
setDisplaySettings
Sets aDisplaySettings
information for the image. The DisplaySettings reflects how the image was displayed in the application or camera UI. -
getExternalSensors
Gets list of Meterlink readings embedded in the image.- Returns:
- Returns a list of
SensorPoll
items. List may be empty.
-
getTextAnnotations
Gets a COPY of text annotations associated with the image. This means updating returnedList
does not impact the image directly. In order to update existing image annotations usesetTextAnnotations(List)
. Annotations are mappings between text label and value. They provide additional information about the image. Pair first element: annotation label (consider it as an annotation title). Labels are _not_ unique. Pair second element: annotation text value (consider it as a plain text note)- Returns:
- a text annotations associated with the file.
- Throws:
RuntimeException
- if failed to read text annotations- See Also:
-
setTextAnnotations
Sets a text annotations associated with the image. Annotations are mappings between text label and value. They provide additional information about the image. Pair first element: annotation label (consider it as an annotation title). Labels are _not_ unique. Pair second element: annotation text value (consider it as a plain text note)- Parameters:
list
- a list with items to be set- Throws:
RuntimeException
- if failed to write text annotations
-
getCameraInformation
Gets theCameraInformation
describing the device the image was taken with.- Returns:
- a
CameraInformation
object for this image.
-
getFusion
Gets aFusion
object set for this image.- Returns:
- Returns a
Fusion
object or null if no fusion information is embedded in the image.
-
getPalette
Gets aPalette
object set for this image. ThePalette
set for theThermalImage
remains unchanged. If parameters of thePalette
obtained from image are changed, use thesetPalette(Palette)
method to set it for the image. After it is set, image's definition will be updated with newPalette
's data.- Returns:
- a
Palette
object set for this image ornull
, if any problem occurred (i.e. image has no valid palette set).
-
setPalette
Sets aPalette
for the Thermal image defined by this instance. If providedPalette
cannot be set, it throws anException
.It is obligatory to give a path on a local device filesystem, where
Palette
's file is located. EachPalette
stores it's color definition in an unique file. ThePalette
loads color definition at a runtime. This definition is not stored in thePalette
's object, hence it must be read whenever givenPalette
is used.- Parameters:
palette
- aPalette
object to be set for this image.
-
getScale
Gets aScale
for this image. The look of theScale
depends onPalette
set for the image. The values defining range and special colors depends onImageParameters
set for the image.- Returns:
- a
Scale
for the image with currentPalette
andImageParameters
.
-
getImageParameters
Gets anImageParameters
object for this instance. TheImageParameters
defines, how Thermal data stored in the image should be interpreted. They have a great impact on temperature values.- Returns:
- an
ImageParameters
describing this image.
-
getStatistics
Gets anImageStatistics
object providing the statistics for Thermal data.- Returns:
- an
ImageStatistics
object related with theThermalImage
.
-
getIsotherms
Gets a collection ofIsotherm
readings embedded in the image.- Returns:
- Returns an
IsothermCollection
object withIsotherm
readings embedded in the image.
-
getMinSpotRadius
public int getMinSpotRadius()This API exposes what min-radius of the visual indicator of a spot is. This size/radius differs depending on image data. Without this information a client will not be able to draw a visually accurate sized spot in a image.- Returns:
- Returns min-radius of the visual indicator of a spot.
-
getValueAt
Gets a temperature value from a point(x,y) in the Thermal Image. Note: Due to Lepton thermal camera core specifics, reading a value from a single point may be inaccurate. Thus this is recommended to use aMeasurementSpot
instead, where value calculation is internally compensated based on a several adjacent points and calibration data.- Parameters:
location
- A point that specifies the location for the value to read.- Returns:
- The temperature value in current unit.
- Throws:
IllegalArgumentException
- when requested position is incorrect (i.e. out of image bounds)- See Also:
-
getValues
Gets temperature values from a list of points(x,y) in the Thermal Image.- Parameters:
points
- A list of points which specifies the location for the value to read.- Returns:
- Temperature values in current unit. `values[n]` corresponds to the value at `points[n]`.
- Throws:
IllegalArgumentException
- when any of the requested points position is incorrect (i.e. out of image bounds)- See Also:
-
getValues
Gets temperature values from a rectangle in the Thermal Image.- Parameters:
rectangle
- A rectangle which specifies the location for the values to be read.- Returns:
- Temperature values in current unit. `values[n]` corresponds to the value at `x + (y * width)` of the rectangle (NOT the width of the ThermalImage).
- Throws:
IllegalArgumentException
- when requestedRectangle
is incorrect (i.e. out of image bounds)- See Also:
-
saveAs
Save this object to a file with provided name. CallssaveAs(String, JavaImageBuffer)
with(fileAbsPath, null)
parameters.Note: a default overlay is added to the picture. See
saveAs(String, JavaImageBuffer)
for details about the overlay.
Note: After a call tosaveAs(String)
the rotation of the image is set to 0.- Parameters:
fileAbsPath
- the path, where the file containing this object will be saved, i.e./sdcard/Flir/images/img001.jpg
.- Throws:
IOException
- when file cannot be stored under the specified path.
-
saveAs
public void saveAs(@NotNull @NotNull String fileAbsPath, @Nullable @Nullable JavaImageBuffer overlay) throws IOException Save current object to a file with provided name.Note: After a call to
saveAs(String)
the rotation of the image is set to 0.- Parameters:
fileAbsPath
- the path, where the file containing this object will be saved, i.e./sdcard/Flir/images/img001.jpg
.overlay
- an overlay to be added to the stored image. The overlay pixels, are used as plain JPEG part when storing the image. This overlay is what a "casual" image viewer application can "see" and also is usually used to show JPEG thumbnail.- Throws:
IOException
- when file cannot be stored under the specified path.
-
getVoiceAnnotation
Gets aVoiceAnnotation
object associated with the image.- Returns:
- a
VoiceAnnotation
.
-
hasVoiceAnnotation
public boolean hasVoiceAnnotation()Checks whether thisThermalImageFile
contains a validVoiceAnnotation
object.- Returns:
- true if a valid
VoiceAnnotation
exists within this image.
-
storeVoiceAnnotation
Stores the audio data to theThermalImage
.- Parameters:
audioData
- byte array with the audio data to storeformat
- sound format the data is encoded in
-
getSketch
Get the sketch image.- Returns:
- A
JavaImageBuffer
with sketch or null if there is no sketch data embedded within the image. The returnedJavaImageBuffer
has the attached internal read-only pixels.
-
addSketch
Set the sketch image.- Parameters:
sketch
- A transparent image as aJavaImageBuffer
.- Returns:
- Returns null if operation succeeded otherwise returns a corresponding
ErrorCode
.
-
close
public void close()Description copied from class:ImageBase
Closes the image and frees all resources.Important: All references to the
ThermalImage
fields became invalid and any further access to them generates exception. You must deep-copy any object before closing aThermalImageFile
, if you want to use it later. -
toString
-
getColorDistributionSettings()
instead.