Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Error using Taucs

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Error using Taucs


Chronological Thread 
  • From: Laurent Saboret <>
  • To:
  • Subject: Re: [cgal-discuss] Error using Taucs
  • Date: Mon, 19 Sep 2011 16:10:37 +0200

Hi Mario,

Please check that you use the latest version of TAUCS:
* on Windows, the recommend way is to use CGAL installer and select the option to download TAUCS (precompiled)
* on Unix, you need to download taucs_full.tgz from https://gforge.inria.fr/frs/?group_id=52 (in section "TAUCS 3.5"), then compile and install it

When TAUCS is installed, you should run again cmake and make (or compile in Visual Studio).

Best regards,
Laurent Saboret


Le 14/09/2011 19:39, Mario Ynocente Castro a écrit :
Hi everyone, i'm testing a method for Poisson Image Editing. However I'm getting the following error : taucs_ccs_ops.c:185: taucs_dccs_permute_symmetrically: Assertion `A->flags & 8 || A->flags & 16' failed.

I've tested  the same method in Visual Studio (seems like it uses a previous version of taucs though), everything seems to
be working in the same way, except for Lmatrix->get_taucs_matrix(), in that version it takes totalpixel as a parameter.

void PoissonImageEditing(float* Fdx, float* Fdy, float* result, int width, int height){
int x,y,index;
int totalpixel = width*height;

//No mask, compute the image from gradient
TaucsMatrix* Lmatrix = new TaucsMatrix(totalpixel, totalpixel, false);
double* Bvector = new double[totalpixel];
memset(Bvector, 0, totalpixel*sizeof(double));

for(y = 0, index = 0; y < height; y++){
for(x = 0; x < width; x++, index++){
//This is second derivative equation
int c = 0;
if( x > 0 ){
Lmatrix->set_coef(index, index-1, -1);
Bvector[index] += Fdx[index];
c++;
}
if( x < width-1 ){
Lmatrix->set_coef(index, index+1, -1);
Bvector[index] -= Fdx[index+1];
c++;
}
if( y > 0 ){
Lmatrix->set_coef(index, index-width, -1);
Bvector[index] += Fdy[index];
c++;
}
if( y < height-1 ){
Lmatrix->set_coef(index, index+width, -1);
Bvector[index] -= Fdy[index+width];
c++;
}

if(c > 0){
Lmatrix->set_coef(index, index, c);
}
}
}

char* solve [] = {"taucs.factor.LU=true", NULL};
int error_code;
    
double* tempResult = new double[totalpixel];
memset(tempResult, 0, totalpixel*sizeof(double));

taucs_ccs_matrix* tm = (taucs_ccs_matrix*)Lmatrix->get_taucs_matrix();

printf("Solve Matrix: %d\n", totalpixel);
error_code = taucs_linsolve( tm, NULL, 1, tempResult, Bvector, solve, NULL);
if(error_code != TAUCS_SUCCESS){
printf("Solver Failed\n");
}

for(index = 0; index < totalpixel; index++){
tempResult[index] += 0.5f;
if(tempResult[index] < 0) tempResult[index] = 0;
if(tempResult[index] > 1) tempResult[index] = 1;

result[index] = (float)(tempResult[index]);
}

delete Lmatrix;
delete [] Bvector;
delete [] tempResult;
}

--
Mario Ynocente Castro
Undergraduate Student of System Engineering
National University of Engineering, Peru



Archive powered by MHonArc 2.6.16.

Top of Page