fix openmp issue with Hot/Dead pixels
This commit is contained in:
@@ -420,19 +420,21 @@ int RawImageSource::cfaCleanFromMap( PixelsMap &bitmapBads )
|
||||
*/
|
||||
int RawImageSource::findHotDeadPixel( PixelsMap &bpMap, float thresh)
|
||||
{
|
||||
int counter=0;
|
||||
volatile int counter=0;
|
||||
|
||||
unsigned short (*cfablur);
|
||||
cfablur = (unsigned short (*)) calloc (H*W, sizeof *cfablur);
|
||||
|
||||
int iprev,inext,jprev,jnext;
|
||||
unsigned short p[9],temp;
|
||||
int top, bottom, left, right;
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma omp parallel
|
||||
{
|
||||
#pragma omp for
|
||||
for (int i=0; i<H; i++) {
|
||||
int iprev,inext,jprev,jnext;
|
||||
unsigned short p[9],temp;
|
||||
if (i<2) {iprev=i+2;} else {iprev=i-2;}
|
||||
if (i>H-3) {inext=i-2;} else {inext=i+2;}
|
||||
for (int j=0; j<W; j++) {
|
||||
@@ -443,7 +445,7 @@ int RawImageSource::findHotDeadPixel( PixelsMap &bpMap, float thresh)
|
||||
rawData[inext][jprev],rawData[inext][j],rawData[inext][jnext],cfablur[i*W+j]);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: counter needs a openmp fix.
|
||||
#pragma omp for
|
||||
//cfa pixel heat/death evaluation
|
||||
for (int rr=0; rr < H; rr++) {
|
||||
@@ -456,6 +458,7 @@ int RawImageSource::findHotDeadPixel( PixelsMap &bpMap, float thresh)
|
||||
//evaluate pixel for heat/death
|
||||
float pixdev = (float)abs(rawData[rr][cc]-cfablur[rr*W+cc]);
|
||||
float hfnbrave=0;
|
||||
int top, bottom, left, right;
|
||||
top=MAX(0,rr-2);
|
||||
bottom=MIN(H-1,rr+2);
|
||||
left=MAX(0,cc-2);
|
||||
|
||||
Reference in New Issue
Block a user