Browse Source

Fix map alignment when using crop noise

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
Xerbo 3 years ago
parent
commit
13d98107ac
4 changed files with 8 additions and 6 deletions
  1. +3
    -3
      src/dsp.c
  2. +3
    -1
      src/image.c
  3. +1
    -1
      src/image.h
  4. +1
    -1
      src/main.c

+ 3
- 3
src/dsp.c View File

@@ -238,9 +238,9 @@ int getpixelrow(float *pixelv, int nrow, int *zenith, int reset) {
lcorr = fir(&pixelv[2], Sync, SyncFilterLen - 2);
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;
}
previous = fabs(lcorr - ecorr);


+ 3
- 1
src/image.c View File

@@ -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
void cropNoise(image_t *img){
int cropNoise(image_t *img){
#define NOISE_THRESH 180.0

// Average value of minute marker
@@ -324,6 +324,8 @@ void cropNoise(image_t *img){

// Ignore the noisy rows at the end
img->nrow = (endCrop - startCrop);

return startCrop;
}

// --- Temperature Calibration --- //


+ 1
- 1
src/image.h View File

@@ -5,5 +5,5 @@ void linearEnhance(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 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);

+ 1
- 1
src/main.c View File

@@ -178,7 +178,7 @@ static int processAudio(char *filename, options_t *opts){

// Crop noise from start and end of image
if(CONTAINS(opts->effects, Crop_Noise)){
cropNoise(&img);
img.zenith -= cropNoise(&img);
}

// Denoise


Loading…
Cancel
Save