13#ifndef OPTRISIMAGEBUILDER_H
14#define OPTRISIMAGEBUILDER_H
17#include "irdirectsdk_defs.h"
34enum EnumOptrisColoringPalette{eAlarmBlue = 1,
53enum EnumOptrisPaletteScalingMethod{eManual = 1,
58typedef unsigned char (*paletteTable)[3];
88 void setData(
unsigned int width,
unsigned int height,
const unsigned short* data);
215 void getPaletteBar(
unsigned int w,
unsigned int h,
unsigned char* &img)
const;
224 void calcHistogram(
unsigned int* hist,
unsigned int histsize,
int tMin,
int tMax)
const;
233 void drawCrosshair(
unsigned char* img,
unsigned int x,
unsigned int y,
unsigned char rgb[3] = NULL)
const;
242 void yuv422torgb24(
const unsigned char* src,
unsigned char* dst,
unsigned int w,
unsigned int h)
const;
252 void convert2PPM(
unsigned char* &ppm,
unsigned int* size,
unsigned char* buffer,
unsigned int width,
unsigned int height)
const;
262 int serializePPM(
const char* filename,
unsigned char* buffer,
unsigned int width,
unsigned int height)
const;
271 int readPPM3(
const char* filename,
unsigned char** buffer,
unsigned int* width,
unsigned int* height);
278 void calculateIntegralImage();
283 void calcMinMaxScalingFactor();
289 void calcSigmaScalingFactor(
float sigma);
294 unsigned short* _data;
297 float _thermalDecimalPlaceDivisor;
300 float _thermalOffset;
305 unsigned long* _integral;
310 EnumOptrisPaletteScalingMethod _scalingMethod;
330 unsigned int _height;
335 unsigned int _stride;
345 EnumOptrisColoringPalette _palette;
355 bool _integralIsDirty;
Image creation module for displaying purposes.
Definition: ImageBuilder.h:66
~ImageBuilder()
Destructor.
float getMeanTemperature(unsigned int u1, unsigned int v1, unsigned int u2, unsigned int v2)
Get mean temperature of rectangular measuring field.
void convertTemperatureToPaletteImage(unsigned char *dst, bool ignoreStride=false)
Image conversion to rgb (bgr on windows)
float getIsothermalMin() const
Get minimum temperature used to scale image.
void setData(unsigned int width, unsigned int height, const unsigned short *data)
Set new data.
EnumOptrisColoringPalette getPalette() const
Get palette for color conversion return coloring palette.
void getPaletteTable(paletteTable &table) const
Get palette table for color conversion.
void setManualTemperatureRange(float min, float max)
Set temperature range for manual scaling method.
float getTemperatureAt(int index) const
Get temperature from last acquired image at specified image index.
void setPalette(EnumOptrisColoringPalette palette)
Set palette for color conversion.
void calcHistogram(unsigned int *hist, unsigned int histsize, int tMin, int tMax) const
calculate histogram
void convertTemperatureToPaletteImage(unsigned int lut[65536], unsigned char *dst)
Image conversion to rgb with lookup table.
void drawCrosshair(unsigned char *img, unsigned int x, unsigned int y, unsigned char rgb[3]=NULL) const
Draw crosshair to the center of image.
EnumOptrisPaletteScalingMethod getPaletteScalingMethod() const
Accessor for activated color conversion mode.
void convert2PPM(unsigned char *&ppm, unsigned int *size, unsigned char *buffer, unsigned int width, unsigned int height) const
Convert palette image to ppm format.
void getMinMaxRegion(unsigned int radius, ExtremalRegion *minRegion, ExtremalRegion *maxRegion)
Get region of minimum/maximum temperature with given radius.
void setPaletteScalingMethod(EnumOptrisPaletteScalingMethod method)
Scaling method of color conversion.
void fillPaletteLookup(unsigned int lut[65536])
Fill lookup table for false color conversion.
unsigned int getWidth() const
Get image width.
void yuv422torgb24(const unsigned char *src, unsigned char *dst, unsigned int w, unsigned int h) const
Convert YUV422 image to RGB format (8-Bit per channel)
void getPaletteBar(unsigned int w, unsigned int h, unsigned char *&img) const
int serializePPM(const char *filename, unsigned char *buffer, unsigned int width, unsigned int height) const
Serialize data to PPM-format.
int readPPM3(const char *filename, unsigned char **buffer, unsigned int *width, unsigned int *height)
Read PPM (P3) format.
float getIsothermalMax() const
Get maximum temperature used to scale image.
unsigned int getHeight() const
Get image height.
unsigned int getStride(void) const
If memory alignment is needed, this class provides a stride parameter configured with setSize(....
float getTemperatureAt(int u, int v) const
Get temperature from last acquired image at specified image coordinates.
ImageBuilder(bool alignStride=true, short decimalPlaces=1)
Standard constructor.
Rectangular area having extremal temperature, i.e., minimum or maximum temperature in a certain image...
Definition: ImageBuilder.h:26
int u2
right-most column index
Definition: ImageBuilder.h:30
float t
mean temperature
Definition: ImageBuilder.h:27
int v2
upper row index
Definition: ImageBuilder.h:31
int v1
lower row index
Definition: ImageBuilder.h:29
int u1
left-most column index
Definition: ImageBuilder.h:28