|
ifw-odp 5.0.0
|
#include "ifw/odp/clipm/clipm_priv_image_edge_operations.h"#include "ifw/odp/clipm/clipm_math.h"#include "ifw/odp/clipm/clipm_priv_image.h"#include "ifw/odp/clipm/clipm_priv_image_signal.h"#include "ifw/odp/clipm/clipm_priv_checks.h"#include "ifw/odp/clipm/clipm_compatibility_replacements.h"#include "ifw/odp/clipm/clipm_priv_error.h"Macros | |
| #define | _clipm_priv_image_polar2cartesian_BODY(CTYPE) |
| #define | clipm_priv_image_compute_angles_BODY(CTYPE) |
| #define | clipm_priv_image_compute_pythagoras_BODY(CTYPE) |
| #define | clipm_priv_image_compute_mean_angle_BODY(CTYPE, BUFFERSTART, IMSIZE, WINDOWSIZE, W_DATA, A_DATA, W_BPM, A_BPM, PERIODICITY, ANGLE, NORM) |
| #define | clipm_priv_image_compute_angular_uniformity_BODY(CTYPE) |
| #define | clipm_priv_image_LOOP_GOOD_2DATA_CONST(TYPE, IMSIZE_XY, WDWSIZE_XY, DATA1_WDW, BADP1_WDW, DATA2_WDW, BADP2_WDW, YACTION, XACTION, XACTION_BAD) |
| Loop over a pixel buffer, only regarding good pixels. | |
| cpl_error_code | clipm_priv_image_compute_gradients (const cpl_image *input, const cpl_size window_xxyy[4], cpl_image **out_magnitudes, cpl_image **out_angles) |
| Compute image gradients. | |
| cpl_image * | clipm_priv_image_conv_sobel_x (const cpl_image *input, const cpl_size window_xxyy[4]) |
| Convolve image with horizontal Sobel operator. | |
| cpl_image * | clipm_priv_image_conv_sobel_y (const cpl_image *input, const cpl_size window_xxyy[4]) |
| Convolve image with vertical Sobel operator. | |
| cpl_image * | clipm_priv_image_compute_angles (const cpl_image *grad_x, const cpl_image *grad_y) |
| Calculate the angles of a gradient field. | |
| cpl_image * | clipm_priv_image_compute_pythagoras (const cpl_image *input1, const cpl_image *input2) |
| Calculate the Pythagoras of two images. | |
| double | clipm_priv_image_compute_mean_angle (const cpl_image *magnitudes, const cpl_image *angles, const cpl_size window_xxyy[4], double periodic_factor, double *out_norm) |
| Compute the mean of an angle-field inside a window. | |
| cpl_error_code | clipm_priv_image_compute_mean_gradients (const cpl_image *magnitudes, const cpl_image *angles, const cpl_size window_xxyy[4], double periodic_factor, double radius_sigma, cpl_image **mean_magnitudes, cpl_image **mean_angles) |
| Lowpass gradients after applying a periodic factor. | |
| cpl_image * | clipm_priv_image_compute_angular_uniformity (const cpl_image *magnitudes, const cpl_image *angles, const cpl_size window_xxyy[4], double radius_sigma, double periodic_factor) |
| Compute an indicator for a uniform pointing direction of gradients. | |
| #define _clipm_priv_image_polar2cartesian_BODY | ( | CTYPE | ) |
| #define clipm_priv_image_compute_angles_BODY | ( | CTYPE | ) |
| #define clipm_priv_image_compute_angular_uniformity_BODY | ( | CTYPE | ) |
| #define clipm_priv_image_compute_mean_angle_BODY | ( | CTYPE, | |
| BUFFERSTART, | |||
| IMSIZE, | |||
| WINDOWSIZE, | |||
| W_DATA, | |||
| A_DATA, | |||
| W_BPM, | |||
| A_BPM, | |||
| PERIODICITY, | |||
| ANGLE, | |||
| NORM ) |
| #define clipm_priv_image_compute_pythagoras_BODY | ( | CTYPE | ) |
| #define clipm_priv_image_LOOP_GOOD_2DATA_CONST | ( | TYPE, | |
| IMSIZE_XY, | |||
| WDWSIZE_XY, | |||
| DATA1_WDW, | |||
| BADP1_WDW, | |||
| DATA2_WDW, | |||
| BADP2_WDW, | |||
| YACTION, | |||
| XACTION, | |||
| XACTION_BAD ) |
Loop over a pixel buffer, only regarding good pixels.
| TYPE | C data type (e.g. int, float, double) |
| IMSIZE_XY | Int buffer of size 2, containing the image size [x, y] |
| WDWSIZE_XY | Int buffer of size 2, containing the window size |
| DATA1_WDW | Pointer to image 1 data (window) |
| BADP1_WDW | Pointer to bad pixel mask 1 data (window) |
| DATA2_WDW | Pointer to image 2 data (window) |
| BADP2_WDW | Pointer to bad pixel mask 2 data (window) |
| YACTION | Action to perform first in each row |
| XACTION | Action to always perform per good pixel |
| XACTION_BAD | Action to always perform per bad pixel |
| cpl_image * clipm_priv_image_compute_angles | ( | const cpl_image * | grad_x, |
| const cpl_image * | grad_y ) |
Calculate the angles of a gradient field.
| grad_x | Image representing the horizontal gradients |
| grad_y | Image representing the vertical gradients |
![$[0\ldots 2\pi]$](form_7.png)
| cpl_image * clipm_priv_image_compute_angular_uniformity | ( | const cpl_image * | magnitudes, |
| const cpl_image * | angles, | ||
| const cpl_size | window_xxyy[4], | ||
| double | radius_sigma, | ||
| double | periodic_factor ) |
Compute an indicator for a uniform pointing direction of gradients.
| magnitudes | Image containing gradient magnitude values |
| angles | Image containing gradient angle values |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
| radius_sigma | Sigma of the gaussian region used for the lowpass |
| periodic_factor | Divisor for the periodicity of ![]() |
| cpl_error_code clipm_priv_image_compute_gradients | ( | const cpl_image * | input, |
| const cpl_size | window_xxyy[4], | ||
| cpl_image ** | out_magnitudes, | ||
| cpl_image ** | out_angles ) |
Compute image gradients.
| input | Input image |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
| out_magnitudes | Pointer to ouput image for absolute gradient |
| out_angles | Pointer to ouput image for gradient angles in the range ![]() |
| double clipm_priv_image_compute_mean_angle | ( | const cpl_image * | magnitudes, |
| const cpl_image * | angles, | ||
| const cpl_size | window_xxyy[4], | ||
| double | periodic_factor, | ||
| double * | out_norm ) |
Compute the mean of an angle-field inside a window.
| magnitudes | Image containing gradient magnitude values (FITS convention) |
| angles | Image containing local angle values (FITS convention) |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
| periodic_factor | Divisor for the periodicity of ![]() |
| out_norm | (Optional output) the gradient's norm |
![$\left[0\cdots \frac{2\pi}{periodic\_factor}\right]$](form_49.png)




![\[\overline\alpha =
\frac{1}{p}\cdot\angle\left(\sum_n w_n\cdot e^{i \alpha\cdot p}\right).\]](form_54.png)
![$[0\ldots 2\pi]$](form_7.png)
![$[0\ldots\pi]$](form_55.png)


![$[0\ldots \pi]$](form_57.png)
| periodic_factor | Example Purpose |
|---|---|
| 1 | Uni-directional (e.g. global) gradients |
| 2 | Lines and rectangular apertures |
| 3 | Equilateral triangles |
| 4 | Square apertures, crossing spikes of secondary mirror holder |
| 6 | Honeycombs |

| cpl_error_code clipm_priv_image_compute_mean_gradients | ( | const cpl_image * | magnitudes, |
| const cpl_image * | angles, | ||
| const cpl_size | window_xxyy[4], | ||
| double | periodic_factor, | ||
| double | radius_sigma, | ||
| cpl_image ** | mean_magnitudes, | ||
| cpl_image ** | mean_angles ) |
Lowpass gradients after applying a periodic factor.
| magnitudes | Image containing gradient magnitude values (FITS convention) |
| angles | Image containing gradient angle values (FITS convention) |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
| periodic_factor | Divisor for the periodicity of ![]() |
| radius_sigma | Sigma of the gaussian used for the lowpass |
| mean_magnitudes | (Optional output) magnitudes of lowpassed gradients |
| mean_angles | (Optional output) angles of lowpassed gradients |
| cpl_image * clipm_priv_image_compute_pythagoras | ( | const cpl_image * | input1, |
| const cpl_image * | input2 ) |
Calculate the Pythagoras of two images.
| input1 | First input image |
| input2 | Second input image |

| cpl_image * clipm_priv_image_conv_sobel_x | ( | const cpl_image * | input, |
| const cpl_size | window_xxyy[4] ) |
Convolve image with horizontal Sobel operator.
| input | Input image |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
![\[S_x = \frac{1}{8}\cdot\left( \begin{array}{rrr}
-1 & 0 & +1 \\
-2 & 0 & +2 \\
-1 & 0 & +1
\end{array}\right) = \frac{1}{8}\cdot \left( \begin{array}{rrr}
-1 & 0 & +1
\end{array}\right) * \left( \begin{array}{r}
1 \\
2 \\
1
\end{array}\right)
\]](form_45.png)
| cpl_image * clipm_priv_image_conv_sobel_y | ( | const cpl_image * | input, |
| const cpl_size | window_xxyy[4] ) |
Convolve image with vertical Sobel operator.
| input | Input image |
| window_xxyy | Coordinate buffer of the form {xa, xb, ya, yb}, can be NULL, minimum/maximum order is irrelevant |
![\[S_x = \frac{1}{8}\cdot\left( \begin{array}{rrr}
+1 & +2 & +1 \\
0 & 0 & 0 \\
-1 & -2 & -1
\end{array}\right) = \frac{1}{8}\cdot \left( \begin{array}{rrr}
1 & 2 & 1
\end{array}\right) * \left( \begin{array}{r}
+1 \\
0 \\
-1
\end{array}\right)
\]](form_46.png)