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.voidclose()Closes the image and frees all resources.Gets theCameraInformationdescribing the device the image was taken with.Deprecated.Gets aColorDistributionSettingsfor the image.Gets a date when the image was taken.@Nullable DisplaySettingsGets aDisplaySettingsinformation for the image.Gets aDistanceUnitused to define any distance parameter related with image.Gets list of Meterlink readings embedded in the image.@Nullable FusionGets aFusionobject set for this image.getImage()Gets aJavaImageBufferobject, which represents an image's colorized pixels data depending on selectedFusionMode.Gets anImageParametersobject for this instance.@NotNull IsothermCollectionGets a collection ofIsothermreadings embedded in the image.Gets aMeasurementShapeCollectionset for the image.intThis API exposes what min-radius of the visual indicator of a spot is.@Nullable PaletteGets aPaletteobject set for this image.@Nullable JavaImageBuffergetPhoto()Deprecated.getScale()Gets aScalefor this image.@Nullable JavaImageBufferGet the sketch image.Gets anImageStatisticsobject providing the statistics for Thermal data.Gets aTemperatureUnittheThermalValues 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 aVoiceAnnotationobject associated with the image.booleanChecks whether thisThermalImageFilecontains a validVoiceAnnotationobject.voidSave this object to a file with provided name.voidsaveAs(@NotNull String fileAbsPath, @Nullable JavaImageBuffer overlay) Save current object to a file with provided name.voidsetColorDistribution(ColorDistribution colorDistribution) Deprecated.voidsetColorDistributionSettings(ColorDistributionSettings colorDistributionSettings) Sets aColorDistributionSettingsto define, how colors should be calculated from the thermal data.voidsetDisplaySettings(@NotNull DisplaySettings displaySettings) Sets aDisplaySettingsinformation for the image.voidsetDistanceUnit(DistanceUnit distanceUnit) Sets aDistanceUnitused to define any distance parameter related with image.voidsetPalette(Palette palette) Sets aPalettefor the Thermal image defined by this instance.voidsetTemperatureUnit(TemperatureUnit temperatureUnit) Sets aTemperatureUnittheThermalValues are in.voidsetTextAnnotations(List<Pair<String, String>> list) Sets a text annotations associated with the image.voidstoreVoiceAnnotation(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:ImageBaseGets aJavaImageBufferobject, which represents an image's colorized pixels data depending on selectedFusionMode. Rendered/colorized image, which size, appearance etc. heavily depends on theFusionModeandColorDistributionSettings.
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_ONLYmode.- Specified by:
getImagein classImageBase- Returns:
- an image buffer as a
JavaImageBuffercontaining image's colorized pixels data depending on selectedFusionMode. - See Also:
-
getPhoto
Deprecated.Gets a visual image (photo) as aJavaImageBufferextracted from the file. This is a full resolution photo that is not fusion aligned.- Returns:
- a visual image (photo) as a
JavaImageBufferextracted from the file ornull, if no visual image is associated with this file.
-
getColorDistribution
Deprecated.UsegetColorDistributionSettings()instead.Gets aColorDistributionmode for the image. The mode depends on the Thermal camera's capabilities.- Returns:
- a
ColorDistributionmode.
-
setColorDistribution
Deprecated.Sets aColorDistributionmode 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 newColorDistributionmode.
-
getColorDistributionSettings
Gets aColorDistributionSettingsfor the image. -
setColorDistributionSettings
Sets aColorDistributionSettingsto define, how colors should be calculated from the thermal data.- Parameters:
colorDistributionSettings- a newColorDistributionSettings.
-
getDistanceUnit
Gets aDistanceUnitused to define any distance parameter related with image.- Returns:
- the
DistanceUnitdefining any distance parameter. - See Also:
-
setDistanceUnit
Sets aDistanceUnitused to define any distance parameter related with image. It is applied to theImageParameters's definition of a distance to the object.- Parameters:
distanceUnit- a newDistanceUnitto be used.- See Also:
-
getTemperatureUnit
Gets aTemperatureUnittheThermalValues are in. It is applied to all values obtained from the image orMeasurementShapes associated with it.- Returns:
- a
TemperatureUnitused to defineThermalValues.
-
setTemperatureUnit
Sets aTemperatureUnittheThermalValues are in. It is applied to all values obtained from the image orMeasurementShapes associated with it.- Parameters:
temperatureUnit- a newTemperatureUnitto be used.
-
getDateTaken
Gets a date when the image was taken.- Returns:
- a date when the image was taken as a Java
Dateobject 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 aMeasurementShapeCollectionset for the image. It contains allMeasurementShapes added and attached to the image. Each measurement in the collection can provide information about temperature measured in the area it covers.- Returns:
- a
MeasurementShapeCollectionset for the image.
-
getDisplaySettings
Gets aDisplaySettingsinformation for the image. The DisplaySettings reflects how the image was displayed in the application or camera UI. -
setDisplaySettings
Sets aDisplaySettingsinformation 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
SensorPollitems. List may be empty.
-
getTextAnnotations
Gets a COPY of text annotations associated with the image. This means updating returnedListdoes 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 theCameraInformationdescribing the device the image was taken with.- Returns:
- a
CameraInformationobject for this image.
-
getFusion
Gets aFusionobject set for this image.- Returns:
- Returns a
Fusionobject or null if no fusion information is embedded in the image.
-
getPalette
Gets aPaletteobject set for this image. ThePaletteset for theThermalImageremains unchanged. If parameters of thePaletteobtained 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
Paletteobject set for this image ornull, if any problem occurred (i.e. image has no valid palette set).
-
setPalette
Sets aPalettefor the Thermal image defined by this instance. If providedPalettecannot be set, it throws anException.It is obligatory to give a path on a local device filesystem, where
Palette's file is located. EachPalettestores it's color definition in an unique file. ThePaletteloads color definition at a runtime. This definition is not stored in thePalette's object, hence it must be read whenever givenPaletteis used.- Parameters:
palette- aPaletteobject to be set for this image.
-
getScale
Gets aScalefor this image. The look of theScaledepends onPaletteset for the image. The values defining range and special colors depends onImageParametersset for the image.- Returns:
- a
Scalefor the image with currentPaletteandImageParameters.
-
getImageParameters
Gets anImageParametersobject for this instance. TheImageParametersdefines, how Thermal data stored in the image should be interpreted. They have a great impact on temperature values.- Returns:
- an
ImageParametersdescribing this image.
-
getStatistics
Gets anImageStatisticsobject providing the statistics for Thermal data.- Returns:
- an
ImageStatisticsobject related with theThermalImage.
-
getIsotherms
Gets a collection ofIsothermreadings embedded in the image.- Returns:
- Returns an
IsothermCollectionobject withIsothermreadings 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 aMeasurementSpotinstead, 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 requestedRectangleis 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 aVoiceAnnotationobject associated with the image.- Returns:
- a
VoiceAnnotation.
-
hasVoiceAnnotation
public boolean hasVoiceAnnotation()Checks whether thisThermalImageFilecontains a validVoiceAnnotationobject.- Returns:
- true if a valid
VoiceAnnotationexists 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
JavaImageBufferwith sketch or null if there is no sketch data embedded within the image. The returnedJavaImageBufferhas 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:ImageBaseCloses the image and frees all resources.Important: All references to the
ThermalImagefields 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.