Commit b13b1ce3 authored by Preet's avatar Preet

demo-distance-field: Fix to pass atlas dimensions to the signed distance...

demo-distance-field: Fix to pass atlas dimensions to the signed distance transform function in the correct order
parent eeb3fc84
......@@ -218,8 +218,8 @@ make_distance_map( unsigned char *img,
}
// Compute outside = edtaa3(bitmap); % Transform background (0's)
computegradient( data, height, width, gx, gy);
edtaa3(data, gx, gy, height, width, xdist, ydist, outside);
computegradient( data, width, height, gx, gy);
edtaa3(data, gx, gy, width, height, xdist, ydist, outside);
for( i=0; i<width*height; ++i)
if( outside[i] < 0 )
outside[i] = 0.0;
......@@ -229,8 +229,8 @@ make_distance_map( unsigned char *img,
memset(gy, 0, sizeof(double)*width*height );
for( i=0; i<width*height; ++i)
data[i] = 1 - data[i];
computegradient( data, height, width, gx, gy);
edtaa3(data, gx, gy, height, width, xdist, ydist, inside);
computegradient( data, width, height, gx, gy);
edtaa3(data, gx, gy, width, height, xdist, ydist, inside);
for( i=0; i<width*height; ++i)
if( inside[i] < 0 )
inside[i] = 0.0;
......
......@@ -77,7 +77,7 @@ distance_map( double *data, unsigned int width, unsigned int height )
int i;
// Compute outside = edtaa3(bitmap); % Transform background (0's)
computegradient( data, height, width, gx, gy);
computegradient( data, width, height, gx, gy);
edtaa3(data, gx, gy, width, height, xdist, ydist, outside);
for( i=0; i<width*height; ++i)
{
......@@ -92,7 +92,7 @@ distance_map( double *data, unsigned int width, unsigned int height )
memset( gy, 0, sizeof(double)*width*height );
for( i=0; i<width*height; ++i)
data[i] = 1 - data[i];
computegradient( data, height, width, gx, gy );
computegradient( data, width, height, gx, gy );
edtaa3( data, gx, gy, width, height, xdist, ydist, inside );
for( i=0; i<width*height; ++i )
{
......
......@@ -201,7 +201,7 @@ make_distance_map( unsigned char *img,
// Compute outside = edtaa3(bitmap); % Transform background (0's)
computegradient( data, width, height, gx, gy);
edtaa3(data, gx, gy, height, width, xdist, ydist, outside);
edtaa3(data, gx, gy, width, height, xdist, ydist, outside);
for( i=0; i<width*height; ++i)
if( outside[i] < 0 )
outside[i] = 0.0;
......@@ -212,7 +212,7 @@ make_distance_map( unsigned char *img,
for( i=0; i<width*height; ++i)
data[i] = 1 - data[i];
computegradient( data, width, height, gx, gy);
edtaa3(data, gx, gy, height, width, xdist, ydist, inside);
edtaa3(data, gx, gy, width, height, xdist, ydist, inside);
for( i=0; i<width*height; ++i)
if( inside[i] < 0 )
inside[i] = 0.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment