68 if (Source->
nline < 1) {
85 if (Source_mask == NULL) {
102 if (Regressed == NULL) {
110 if (Regressed_mask == NULL) {
131 Regression_coeff_map_info,
133 ®ression_coeff_resampled);
140 for (iline = 0 ; iline < Source->
nline ; iline++) {
141 for (isample = 0 ; isample < Source->
nsample ; isample++) {
142 if (Source_mask->
data.
u8[iline][isample]) {
149 regressed_tmp.
data.
f[iline][isample] =
150 Source->
data.
f[iline][isample] *
151 regression_coeff_resampled.
slope.
data.
f[iline][isample] +
153 regressed_mask_tmp.
data.
u8[iline][isample] = 1;
175 *Regressed = regressed_tmp;
176 *Regressed_mask = regressed_mask_tmp;
MTKt_status MtkDataBufferAllocate(int nline, int nsample, MTKt_DataType datatype, MTKt_DataBuffer *databuf)
Allocate Data Buffer.
MTKt_DataBuffer valid_mask
MTKt_status MtkApplyRegression(const MTKt_DataBuffer *Source, const MTKt_DataBuffer *Source_mask, const MTKt_MapInfo *Source_map_info, const MTKt_RegressionCoeff *Regression_coeff, const MTKt_MapInfo *Regression_coeff_map_info, MTKt_DataBuffer *Regressed, MTKt_DataBuffer *Regressed_mask)
Apply regression to given data. Uses MtkResampleCubicConvolution to resample regression coefficients ...
2-dimensional Data Buffer
#define MTKT_DATABUFFER_INIT
MTKt_status MtkDataBufferFree(MTKt_DataBuffer *databuf)
Free data buffer.
MTKt_status MtkResampleRegressionCoeff(const MTKt_RegressionCoeff *Regression_coeff, const MTKt_MapInfo *Regression_coeff_map_info, const MTKt_MapInfo *Target_map_info, MTKt_RegressionCoeff *Regression_coeff_out)
Resample regression coefficients at each pixel in the target map. Resampling is by cubic convolution...
MTKt_DataBuffer intercept
MTKt_status MtkRegressionCoeffFree(MTKt_RegressionCoeff *regressbuf)
Free memory for regression coefficients.
#define MTK_ERR_CODE_MSG_JUMP(code, msg)
#define MTKT_REGRESSION_COEFF_INIT
#define MTK_ERR_COND_JUMP(code)