void repair_badpixel() /*Funktion zum Reparieren der gefundenen badpixel. Wird für jedes Frame ausgeführt*/
{
int badpix_list;
for (badpix_list = 0; badpix_list <= cold_pixels; badpix_list++) /*Schaue die gefundenen badpixel der Reihe nach an*/
{ int x = reduced_x[badpix_list];
int y = reduced_y[badpix_list];
int neighbours[100];
int i,j;
int k = 0;
int fc0 = FC(x, y);
for (i = -4; i <= 4; i++) /*Schaue die Nachbarn des gefundenen badpixel an, und zwar 4 in jede Richtung*/
{
for (j = -4; j <= 4; j++) /* dito */
{
if (i == 0 && j == 0) /* das badpixel selber wird nicht beachtet*/
continue;
if (FC(x+j, y+i) != fc0) /*und es werden nur Nachbarn der gleiche Farbe berpcksichtigt, die das badpixel haben sollte*/
continue;
int p = raw_get_pixel(x+j, y+i); /*Hole den Wert des jeweiligen Nachbarn*/
neighbours[k++] = -p; /*und speichere ihn in einer Liste*/
}
}
if (k <= 4)
continue;
reduced_pixmap[badpix_list] = -median_int_wirth(neighbours, k);
raw_set_pixel(x, y, reduced_pixmap[badpix_list]);
}
}
Why if(k <= 4)? On the first look I see no big differece, If I have this in the code or commented it out.
Edgar