ImFusion SDK 4.3

#include <ImFusion/CT/Legacy/Vision.h>

Legacy computer vision algorithms for CT. More...

Detailed Description

Legacy computer vision algorithms for CT.

Provides backward compatibility for vision-based processing utilities.

Static Public Member Functions

static void normalizeImage (const MemImage *imgIn, MemImage *imgOut)
 Normalize image to range [0,1].
 
template<typename T1, typename T2>
static void thresholdImage (const TypedImage< T1 > *imgIn, TypedImage< T2 > *imgOut, T1 threshold1, T1 threshold2, int mode)
 Computes image minimum and maximum value.
 
static int findConnectedComponents (const MemImage *img, TypedImage< unsigned short > *labelMap, int maxComponents=-1, int minComponentSize=-1)
 Find connected components in image.
 
static void computeGradientMagnitude (const MemImage *img, TypedImage< float > *gradient, bool normalizeResult=true, TypedImage< float > *orientation=0)
 Compute normalized gradient magnitude using 3x3 Sobel.
 
static void computeSubpixelEdgeLocation (TypedImage< float > *gradient, TypedImage< float > *orientation, TypedImage< float > *location)
 Compute sub-pixel edge location.
 
template<typename T>
static int Watershed (const TypedImage< T > *img, TypedImage< unsigned short > *labelMap)
 Watershed segmentation.
 
template<typename T>
static void inpaintImage (const TypedImage< T > *imgIn, TypedImage< T > *imgOut, const TypedImage< unsigned char > *mask, int mode)
 Inpaint missing image regions using linear interpolation between region borders.
 
static void computeDeviceOpenGLMatrices (int frame, const DeviceParameters &p, Eigen::Matrix4d &PM, Eigen::Matrix4d &MV)
 Compute OpenGL matrices for a certain frame based on device parameters.
 
static void computeDeviceProjectionMatrices (int frame, const DeviceParameters &p, int width, int height, Eigen::Matrix< double, 3, 4 > &P)
 Compute computer vision projection matrix for a certain frame based on device parameters.
 
static void extractDeviceParametersFromOpenGLMatrices (const std::vector< Eigen::Matrix4d > &PM, const std::vector< Eigen::Matrix4d > &MV, int width, int height, double pixelSize, DeviceParameters &p, vec3 *outCircleCenter=nullptr, double *outCircleRadius=nullptr, mat3 *outCircleNormalToZ=nullptr)
 Extract device parameters from OpenGL matrices.
 
static void extractDeviceParametersFromProjectionMatrices (const std::vector< Eigen::Matrix< double, 3, 4 > > &P, int width, int height, double pixelSize, DeviceParameters &p, vec3 *outCircleCenter=nullptr, double *outCircleRadius=nullptr, mat3 *outCircleNormalToZ=nullptr)
 Extract device parameters from computer vision projection matrices.
 
static void normalise2Dpts (Eigen::MatrixXd &pts, Eigen::MatrixXd &newPts, Eigen::Matrix3d &T)
 
static void homogenizePoints (Eigen::MatrixXd &pts)
 

Member Function Documentation

◆ normalizeImage()

static void normalizeImage ( const MemImage * imgIn,
MemImage * imgOut )
static

Normalize image to range [0,1].

Parameters
imgIninput image
imgOutoutput image. Can be identical to imgIn.

◆ thresholdImage()

template<typename T1, typename T2>
static void thresholdImage ( const TypedImage< T1 > * imgIn,
TypedImage< T2 > * imgOut,
T1 threshold1,
T1 threshold2,
int mode )
static

Computes image minimum and maximum value.

Parameters
imgimage
minValminimum value
maxValmaximum value Threshold image
imgIninput image
imgOutthresholded image. Can be identical to imgIn.
threshold1threshold 1
threshold2threshold 2
modemode of operation. 0: <= threshold1, 1: >= threshold1, 2: >= threshold1& <= threshold2

◆ findConnectedComponents()

static int findConnectedComponents ( const MemImage * img,
TypedImage< unsigned short > * labelMap,
int maxComponents = -1,
int minComponentSize = -1 )
static

Find connected components in image.

Parameters
imginput binary image. Connected components are computed for image areas with values bigger zero.
labelMaplabel map. Same size as img. Contains the connected component label for every pixel. Background pixels have zero value.
maxComponentsmaximum number of components to find. -1 for all.
minComponentSizeminimum size of detected components. -1 for all sizes. /return number of connected components

◆ computeGradientMagnitude()

static void computeGradientMagnitude ( const MemImage * img,
TypedImage< float > * gradient,
bool normalizeResult = true,
TypedImage< float > * orientation = 0 )
static

Compute normalized gradient magnitude using 3x3 Sobel.

The border of the image is set to zero.

Parameters
imginput image
gradientgradient image. Has to be float type.

◆ computeSubpixelEdgeLocation()

static void computeSubpixelEdgeLocation ( TypedImage< float > * gradient,
TypedImage< float > * orientation,
TypedImage< float > * location )
static

Compute sub-pixel edge location.

Parameters
gradientgradient image
orientationorientation image
locationoutput image with sub-pixel edge locations

◆ Watershed()

template<typename T>
static int Watershed ( const TypedImage< T > * img,
TypedImage< unsigned short > * labelMap )
static

Watershed segmentation.

For details see Cousty et al. "Watershed Cuts: Minimum Spanning Forests and the Drop of Water Principle"

Parameters
imginput image
labelMapimage containing label for every pixel

◆ inpaintImage()

template<typename T>
static void inpaintImage ( const TypedImage< T > * imgIn,
TypedImage< T > * imgOut,
const TypedImage< unsigned char > * mask,
int mode )
static

Inpaint missing image regions using linear interpolation between region borders.

Parameters
imgIninput image
imgOutoutput image. Can be identical to imgIn
maskmask. Image regions where the mask is bigger zero are filled in
modeinpainting mode. 1: interpolate horizontally, 2: interpolate vertically, 3: interpolate horizontally and vertically

◆ computeDeviceOpenGLMatrices()

static void computeDeviceOpenGLMatrices ( int frame,
const DeviceParameters & p,
Eigen::Matrix4d & PM,
Eigen::Matrix4d & MV )
static

Compute OpenGL matrices for a certain frame based on device parameters.

Parameters
frameframe
pdevice parameters
PMprojection matrix
MVmodel view matrix

◆ computeDeviceProjectionMatrices()

static void computeDeviceProjectionMatrices ( int frame,
const DeviceParameters & p,
int width,
int height,
Eigen::Matrix< double, 3, 4 > & P )
static

Compute computer vision projection matrix for a certain frame based on device parameters.

Parameters
frameframe
pdevice parameters
widthimage width
heightimage height
Pprojection matrix

◆ extractDeviceParametersFromOpenGLMatrices()

static void extractDeviceParametersFromOpenGLMatrices ( const std::vector< Eigen::Matrix4d > & PM,
const std::vector< Eigen::Matrix4d > & MV,
int width,
int height,
double pixelSize,
DeviceParameters & p,
vec3 * outCircleCenter = nullptr,
double * outCircleRadius = nullptr,
mat3 * outCircleNormalToZ = nullptr )
static

Extract device parameters from OpenGL matrices.

Parameters
PMprojection matrix
MVmodel view matrices
widthimage width
heightimage height
pixelSizepixel size
poutput device parameters \params outCircleCenter, outCircleRadius, outCircleNormalToZ if not nullptr, write data determining estimated detector circle into these.

◆ extractDeviceParametersFromProjectionMatrices()

static void extractDeviceParametersFromProjectionMatrices ( const std::vector< Eigen::Matrix< double, 3, 4 > > & P,
int width,
int height,
double pixelSize,
DeviceParameters & p,
vec3 * outCircleCenter = nullptr,
double * outCircleRadius = nullptr,
mat3 * outCircleNormalToZ = nullptr )
static

Extract device parameters from computer vision projection matrices.

Parameters
Pprojection matrices
widthimage width
heightimage height
pixelSizepixel size
poutput device parameters \params outCircleCenter, outCircleRadius, outCircleNormalToZ if not nullptr, write data determining estimated detector circle into these.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close