Ask Your Question

Revision history [back]

Example :

int mmm=-2;
int www=256&-mmm;
cout << www <<"\n";
www=257&-mmm;
cout << www <<"\n";

It gives 256 256

like this you are sure you can have a integer center for following lines

int cx = magI.cols/2;
int cy = magI.rows/2;

PS -2 = 0xfffffffe

Example :

int mmm=-2;
int www=256&-mmm;
cout << www <<"\n";
www=257&-mmm;
cout << www <<"\n";

It gives 256 256

like this you are sure you can have a integer center ( no remainder) for following lines

int cx = magI.cols/2;
int cy = magI.rows/2;

PS -2 = 0xfffffffe

Example :

int mmm=-2;
int www=256&-mmm;
www=256&mmm;
cout << www <<"\n";
www=257&-mmm;
www=257-mmm;
cout << www <<"\n";

It gives 256 256

like this you are sure you can have a integer center ( no remainder) for following lines

int cx = magI.cols/2;
int cy = magI.rows/2;

PS -2 = 0xfffffffe

Example :

int mmm=-2;
int www=256&mmm;
cout << www <<"\n";
www=257-mmm;
www=257&mmm;
cout << www <<"\n";

It gives 256 256

like this you are sure you can have a integer center ( no remainder) for following lines

int cx = magI.cols/2;
int cy = magI.rows/2;

PS -2 = 0xfffffffe