|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Useful functions for working with images
Classes | |
| class | mx::improc::sourceFinder< _realT > |
| Find stars in an image by SNR thresholding. More... | |
Functions | |
| template<typename realT > | |
| int | mx::improc::circleOuterpix (realT &x0, realT &y0, realT &avgr0, realT &avgx, realT &avgy, realT &avgr, eigenImage< realT > &circ, const eigenImage< realT > &masked) |
| Find the center and the outermost pixels of a circular mask, giving an estimate of the radius. | |
| int mx::improc::circleOuterpix | ( | realT & | x0, |
| realT & | y0, | ||
| realT & | avgr0, | ||
| realT & | avgx, | ||
| realT & | avgy, | ||
| realT & | avgr, | ||
| eigenImage< realT > & | circ, | ||
| const eigenImage< realT > & | masked | ||
| ) |
Find the center and the outermost pixels of a circular mask, giving an estimate of the radius.
Takes a 1/0 mask of a filled circle or annulus, and calculates the center coordinate by center-of-light, then finds the outermost 1 pixel in each row and column. Calculates the average radius of these pixels w.r.t. to the c.o.l. coords, as well as w.r.t. the average coords of the outer pixels themselves.
Also produces an image containing the outer pixels.
| realT | the real floating-point type for calculations |
| y0 | < [out] x coord of center of the mask by center-of-light |
| avgr0 | < [out] y coord of center of the mask by center-of-light |
| avgx | < [out] average radius of edge pixels w.r.t. center-of-light |
| avgy | < [out] x coord of center of the mask by average edge pixel |
| avgr | < [out] y coord of center of the mask by average edge pixel |
| circ | < [out] average radius of edge pixels w.r.t. to average edge pixel |
| masked | < [out] image showing the edge pixels with value 1, all other pixels 0. Resized. < [in] an image with a (roughly) circular mask of 1s |
Definition at line 55 of file circleOuterpix.hpp.
References mx::improc::imageCenterOfLight().
| void * mx::improc::imcpy | ( | void * | dest, |
| void * | src, | ||
| size_t | width, | ||
| size_t | height, | ||
| size_t | szof | ||
| ) |
Copy one image to another, with no transformation.
This is merely memcpy
| [out] | dest | the address of the first pixel in the destination image |
| [in] | src | the address of the first pixel in the source image |
| [in] | width | the width in pixels of size szof |
| [in] | height | the height in pixels of size szof |
| [in] | szof | the size in bytes of a one pixel |
Definition at line 35 of file imageUtils.cpp.
| void * mx::improc::imcpy_flipLR | ( | void * | dest, |
| void * | src, | ||
| size_t | width, | ||
| size_t | height, | ||
| size_t | szof | ||
| ) |
Copy one image to another, flipping left-right.
| [out] | dest | the address of the first pixel in the destination image |
| [in] | src | the address of the first pixel in the source image |
| [in] | width | the width in pixels of size szof |
| [in] | height | the height in pixels of size szof |
| [in] | szof | the size in bytes of a one pixel |
Definition at line 50 of file imageUtils.cpp.
| void * mx::improc::imcpy_flipUD | ( | void * | dest, |
| void * | src, | ||
| size_t | width, | ||
| size_t | height, | ||
| size_t | szof | ||
| ) |
Copy one image to another, flipping up-down.
This is a reversed row-by-row memcpy
| [out] | dest | the address of the first pixel in the destination image |
| [in] | src | the address of the first pixel in the source image |
| [in] | width | the width in pixels of size szof |
| [in] | height | the height in pixels of size szof |
| [in] | szof | the size in bytes of a one pixel |
Definition at line 40 of file imageUtils.cpp.
| void * mx::improc::imcpy_flipUDLR | ( | void * | dest, |
| void * | src, | ||
| size_t | width, | ||
| size_t | height, | ||
| size_t | szof | ||
| ) |
Copy one image to another, flipping up-down and left-right.
| [out] | dest | the address of the first pixel in the destination image |
| [in] | src | the address of the first pixel in the source image |
| [in] | width | the width in pixels of size szof |
| [in] | height | the height in pixels of size szof |
| [in] | szof | the size in bytes of a one pixel |
Definition at line 118 of file imageUtils.cpp.
|
inline |
Check if the number is nan, using several different methods.
Definition at line 83 of file imageUtils.hpp.
Referenced by mx::improc::zeroNaNCube(), and mx::improc::zeroNaNs().
| int mx::improc::reflectImageCoords | ( | int & | x1, |
| int & | y1, | ||
| int | x0, | ||
| int | y0, | ||
| realT | xc, | ||
| realT | yc | ||
| ) |
Reflect pixel coordinates across the given center pixel.
| [out] | x1 | the reflected x coordinate |
| [out] | y1 | the reflected y coordinate |
| [in] | x0 | the input x coordinate |
| [in] | y0 | the input y coordinate |
| [in] | xc | the center pixel x coordinate |
| [in] | yc | the center pixel y coordinate |
Definition at line 93 of file imageUtils.hpp.
Referenced by mx::improc::reflectImageIndices().