Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The first thing you have to keep in mind is that you have to separate the "image" from your "data". You will use the "image" to display it or save it to disk and usually don't need much precision. The "data" you need to process, depending on the problem, does need more precision.

Another thing to take into account is how much accuracy you need, if it is not too much you could multiply your data by 1000, and if you work with integers it would be like using values with three decimals.

Finally, if you need to use floats you must do the conversion yourself so that the result is correct. This will depend on the scale you are using (for example: pix/255)