%
*/
-static void RadonProjection(const Image *image,MatrixInfo *source_cells,
- MatrixInfo *destination_cells,const ssize_t sign,size_t *projection)
+static void RadonProjection(const Image *image,MatrixInfo *source_matrixs,
+ MatrixInfo *destination_matrixs,const ssize_t sign,size_t *projection)
{
MatrixInfo
*swap;
size_t
step;
- p=source_cells;
- q=destination_cells;
+ p=source_matrixs;
+ q=destination_matrixs;
for (step=1; step < GetMatrixColumns(p); step*=2)
{
for (x=0; x < (ssize_t) GetMatrixColumns(p); x+=2*(ssize_t) step)
y;
unsigned short
- cell,
+ element,
neighbor;
for (i=0; i < (ssize_t) step; i++)
{
for (y=0; y < (ssize_t) (GetMatrixRows(p)-i-1); y++)
{
- if (GetMatrixElement(p,x+i,y,&cell) == MagickFalse)
+ if (GetMatrixElement(p,x+i,y,&element) == MagickFalse)
continue;
if (GetMatrixElement(p,x+i+step,y+i,&neighbor) == MagickFalse)
continue;
- neighbor+=cell;
+ neighbor+=element;
if (SetMatrixElement(q,x+2*i,y,&neighbor) == MagickFalse)
continue;
if (GetMatrixElement(p,x+i+step,y+i+1,&neighbor) == MagickFalse)
continue;
- neighbor+=cell;
+ neighbor+=element;
if (SetMatrixElement(q,x+2*i+1,y,&neighbor) == MagickFalse)
continue;
}
for ( ; y < (ssize_t) (GetMatrixRows(p)-i); y++)
{
- if (GetMatrixElement(p,x+i,y,&cell) == MagickFalse)
+ if (GetMatrixElement(p,x+i,y,&element) == MagickFalse)
continue;
if (GetMatrixElement(p,x+i+step,y+i,&neighbor) == MagickFalse)
continue;
- neighbor+=cell;
+ neighbor+=element;
if (SetMatrixElement(q,x+2*i,y,&neighbor) == MagickFalse)
continue;
- if (SetMatrixElement(q,x+2*i+1,y,&cell) == MagickFalse)
+ if (SetMatrixElement(q,x+2*i+1,y,&element) == MagickFalse)
continue;
}
for ( ; y < (ssize_t) GetMatrixRows(p); y++)
{
- if (GetMatrixElement(p,x+i,y,&cell) == MagickFalse)
+ if (GetMatrixElement(p,x+i,y,&element) == MagickFalse)
continue;
- if (SetMatrixElement(q,x+2*i,y,&cell) == MagickFalse)
+ if (SetMatrixElement(q,x+2*i,y,&element) == MagickFalse)
continue;
- if (SetMatrixElement(q,x+2*i+1,y,&cell) == MagickFalse)
+ if (SetMatrixElement(q,x+2*i+1,y,&element) == MagickFalse)
continue;
}
}
delta;
unsigned short
- cell,
+ element,
neighbor;
- if (GetMatrixElement(p,x,y,&cell) == MagickFalse)
+ if (GetMatrixElement(p,x,y,&element) == MagickFalse)
continue;
if (GetMatrixElement(p,x,y+1,&neighbor) == MagickFalse)
continue;
- delta=(ssize_t) cell-(ssize_t) neighbor;
+ delta=(ssize_t) element-(ssize_t) neighbor;
sum+=delta*delta;
}
projection[GetMatrixColumns(p)+sign*x-1]=sum;
*image_view;
MatrixInfo
- *destination_cells,
- *source_cells;
+ *destination_matrixs,
+ *source_matrixs;
MagickBooleanType
status;
bits[256];
for (width=1; width < ((image->columns+7)/8); width<<=1) ;
- source_cells=AcquireMatrixInfo(width,image->rows,sizeof(unsigned short),
+ source_matrixs=AcquireMatrixInfo(width,image->rows,sizeof(unsigned short),
exception);
- destination_cells=AcquireMatrixInfo(width,image->rows,sizeof(unsigned short),
+ destination_matrixs=AcquireMatrixInfo(width,image->rows,sizeof(unsigned short),
exception);
- if ((source_cells == (MatrixInfo *) NULL) ||
- (destination_cells == (MatrixInfo *) NULL))
+ if ((source_matrixs == (MatrixInfo *) NULL) ||
+ (destination_matrixs == (MatrixInfo *) NULL))
{
- if (destination_cells != (MatrixInfo *) NULL)
- destination_cells=DestroyMatrixInfo(destination_cells);
- if (source_cells != (MatrixInfo *) NULL)
- source_cells=DestroyMatrixInfo(source_cells);
+ if (destination_matrixs != (MatrixInfo *) NULL)
+ destination_matrixs=DestroyMatrixInfo(destination_matrixs);
+ if (source_matrixs != (MatrixInfo *) NULL)
+ source_matrixs=DestroyMatrixInfo(source_matrixs);
return(MagickFalse);
}
- if (ResetMatrixInfo(source_cells) == MagickFalse)
+ if (ResetMatrixInfo(source_matrixs) == MagickFalse)
{
- destination_cells=DestroyMatrixInfo(destination_cells);
- source_cells=DestroyMatrixInfo(source_cells);
+ destination_matrixs=DestroyMatrixInfo(destination_matrixs);
+ source_matrixs=DestroyMatrixInfo(source_matrixs);
return(MagickFalse);
}
for (i=0; i < 256; i++)
if (bit == 8)
{
value=bits[byte];
- (void) SetMatrixElement(source_cells,--i,y,&value);
+ (void) SetMatrixElement(source_matrixs,--i,y,&value);
bit=0;
byte=0;
}
{
byte<<=(8-bit);
value=bits[byte];
- (void) SetMatrixElement(source_cells,--i,y,&value);
+ (void) SetMatrixElement(source_matrixs,--i,y,&value);
}
}
- RadonProjection(image,source_cells,destination_cells,-1,projection);
- (void) ResetMatrixInfo(source_cells);
+ RadonProjection(image,source_matrixs,destination_matrixs,-1,projection);
+ (void) ResetMatrixInfo(source_matrixs);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(status) \
magick_threads(image,image,image->rows,1)
if (bit == 8)
{
value=bits[byte];
- (void) SetMatrixElement(source_cells,i++,y,&value);
+ (void) SetMatrixElement(source_matrixs,i++,y,&value);
bit=0;
byte=0;
}
{
byte<<=(8-bit);
value=bits[byte];
- (void) SetMatrixElement(source_cells,i++,y,&value);
+ (void) SetMatrixElement(source_matrixs,i++,y,&value);
}
}
- RadonProjection(image,source_cells,destination_cells,1,projection);
+ RadonProjection(image,source_matrixs,destination_matrixs,1,projection);
image_view=DestroyCacheView(image_view);
- destination_cells=DestroyMatrixInfo(destination_cells);
- source_cells=DestroyMatrixInfo(source_cells);
+ destination_matrixs=DestroyMatrixInfo(destination_matrixs);
+ source_matrixs=DestroyMatrixInfo(source_matrixs);
return(MagickTrue);
}