Skip to content

Commit

Permalink
Fix issue at the edge in gravi_image_extract_dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
FerreolS committed Apr 22, 2024
1 parent dea7185 commit de35de5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gravi/gravi_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,17 @@ int * gravi_image_extract_dimension (cpl_image * img_profile)


vector = cpl_vector_filter_median_create (vect_mean, hw_median_window);

// zeroing un-filtered values
for (cpl_size i = 0; i< hw_median_window; i++)
{
cpl_vector_set (vector, i, 0.0);
cpl_vector_set (vector, nx - i - 1, 0.0);
}


vect_sorted = cpl_vector_duplicate (vector) ;
cpl_vector_sort( vect_sorted,CPL_SORT_DESCENDING);
sig = cpl_vector_get (vect_sorted,SPECTRAL_LEN);
sig = cpl_vector_get (vect_sorted,SPECTRAL_LEN -1);

int i_1 =hw_median_window+1;
for (cpl_size i = hw_median_window+1; i < nx - hw_median_window - 1; i++){ // the border < hw_median_window is not median filtered
Expand Down

0 comments on commit de35de5

Please sign in to comment.