int samples = 8;
for (unsigned int i = 0; i < (pow(double(2),samples)-1); i++)
{
unsigned int number = i << 1;
}
I am doing the coding in C++ using Opencv library. I want to do bitshift through this and this should be in the range of 0-255 but it is crossing the 255 range and going till 508.
IN Matlab the bitshift operator keeps the range between 0-255. The pattern in matlab is 0,2,4...254,1,3,5...255. But in C++ its going 0,2,4,254,256,258...508. I want the same answer as the matlab. Please suggest me some idea to do that.