The crop noise effect shifts the enetire image in memory, however when applying a map this shift did not get taken into account.tags/v1.8.0
@@ -238,9 +238,9 @@ int getpixelrow(float *pixelv, int nrow, int *zenith, int reset) { | |||||
lcorr = fir(&pixelv[2], Sync, SyncFilterLen - 2); | lcorr = fir(&pixelv[2], Sync, SyncFilterLen - 2); | ||||
FreqLine = 1.0+((ecorr-lcorr) / corr / PixelLine / 4.0); | FreqLine = 1.0+((ecorr-lcorr) / corr / PixelLine / 4.0); | ||||
// Find the point in which ecorr and lcorr intercept | |||||
if(fabs(lcorr - ecorr) < minDoppler && fabs(fabs(lcorr - ecorr) - previous) < 10){ | |||||
minDoppler = fabs(lcorr - ecorr); | |||||
double val = fabs(lcorr - ecorr)*0.25 + previous*0.75; | |||||
if(val < minDoppler && nrow > 10){ | |||||
minDoppler = val; | |||||
*zenith = nrow; | *zenith = nrow; | ||||
} | } | ||||
previous = fabs(lcorr - ecorr); | previous = fabs(lcorr - ecorr); | ||||
@@ -279,7 +279,7 @@ void flipImage(image_t *img, int width, int offset){ | |||||
} | } | ||||
// Calculate crop to reomve noise from the start and end of an image | // Calculate crop to reomve noise from the start and end of an image | ||||
void cropNoise(image_t *img){ | |||||
int cropNoise(image_t *img){ | |||||
#define NOISE_THRESH 180.0 | #define NOISE_THRESH 180.0 | ||||
// Average value of minute marker | // Average value of minute marker | ||||
@@ -324,6 +324,8 @@ void cropNoise(image_t *img){ | |||||
// Ignore the noisy rows at the end | // Ignore the noisy rows at the end | ||||
img->nrow = (endCrop - startCrop); | img->nrow = (endCrop - startCrop); | ||||
return startCrop; | |||||
} | } | ||||
// --- Temperature Calibration --- // | // --- Temperature Calibration --- // | ||||
@@ -5,5 +5,5 @@ void linearEnhance(float **prow, int nrow, int offset, int width); | |||||
int calibrate(float **prow, int nrow, int offset, int width) ; | int calibrate(float **prow, int nrow, int offset, int width) ; | ||||
void denoise(float **prow, int nrow, int offset, int width); | void denoise(float **prow, int nrow, int offset, int width); | ||||
void flipImage(image_t *img, int width, int offset); | void flipImage(image_t *img, int width, int offset); | ||||
void cropNoise(image_t *img); | |||||
int cropNoise(image_t *img); | |||||
void temperature(options_t *opts, image_t *img, int offset, int width); | void temperature(options_t *opts, image_t *img, int offset, int width); |
@@ -178,7 +178,7 @@ static int processAudio(char *filename, options_t *opts){ | |||||
// Crop noise from start and end of image | // Crop noise from start and end of image | ||||
if(CONTAINS(opts->effects, Crop_Noise)){ | if(CONTAINS(opts->effects, Crop_Noise)){ | ||||
cropNoise(&img); | |||||
img.zenith -= cropNoise(&img); | |||||
} | } | ||||
// Denoise | // Denoise | ||||