![]() |
ImFusion SDK 4.3
|
#include <ImFusion/CT/Legacy/Vision.h>
Legacy computer vision algorithms for CT. More...
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) |
Normalize image to range [0,1].
| imgIn | input image |
| imgOut | output image. Can be identical to imgIn. |
|
static |
Computes image minimum and maximum value.
| img | image |
| minVal | minimum value |
| maxVal | maximum value Threshold image |
| imgIn | input image |
| imgOut | thresholded image. Can be identical to imgIn. |
| threshold1 | threshold 1 |
| threshold2 | threshold 2 |
| mode | mode of operation. 0: <= threshold1, 1: >= threshold1, 2: >= threshold1& <= threshold2 |
|
static |
Find connected components in image.
| img | input binary image. Connected components are computed for image areas with values bigger zero. |
| labelMap | label map. Same size as img. Contains the connected component label for every pixel. Background pixels have zero value. |
| maxComponents | maximum number of components to find. -1 for all. |
| minComponentSize | minimum size of detected components. -1 for all sizes. /return number of connected components |
|
static |
Compute normalized gradient magnitude using 3x3 Sobel.
The border of the image is set to zero.
| img | input image |
| gradient | gradient image. Has to be float type. |
|
static |
Compute sub-pixel edge location.
| gradient | gradient image |
| orientation | orientation image |
| location | output image with sub-pixel edge locations |
|
static |
Watershed segmentation.
For details see Cousty et al. "Watershed Cuts: Minimum Spanning Forests and the Drop of Water Principle"
| img | input image |
| labelMap | image containing label for every pixel |
|
static |
Inpaint missing image regions using linear interpolation between region borders.
| imgIn | input image |
| imgOut | output image. Can be identical to imgIn |
| mask | mask. Image regions where the mask is bigger zero are filled in |
| mode | inpainting mode. 1: interpolate horizontally, 2: interpolate vertically, 3: interpolate horizontally and vertically |
|
static |
Compute OpenGL matrices for a certain frame based on device parameters.
| frame | frame |
| p | device parameters |
| PM | projection matrix |
| MV | model view matrix |
|
static |
Compute computer vision projection matrix for a certain frame based on device parameters.
| frame | frame |
| p | device parameters |
| width | image width |
| height | image height |
| P | projection matrix |
|
static |
Extract device parameters from OpenGL matrices.
| PM | projection matrix |
| MV | model view matrices |
| width | image width |
| height | image height |
| pixelSize | pixel size |
| p | output device parameters \params outCircleCenter, outCircleRadius, outCircleNormalToZ if not nullptr, write data determining estimated detector circle into these. |
|
static |
Extract device parameters from computer vision projection matrices.
| P | projection matrices |
| width | image width |
| height | image height |
| pixelSize | pixel size |
| p | output device parameters \params outCircleCenter, outCircleRadius, outCircleNormalToZ if not nullptr, write data determining estimated detector circle into these. |