1 | initial version |
You should have a look at that page for an overview of pixels' access in OpenCV.
But for a short answer, you could do like this:
float* p;
float* q;
for( int i = 0; i < image.rows; ++i)
{
p = image.ptr< float >( i );
q = image2.ptr< float >( i ); // I guess image2 is the same size as image1
// and both image are in float!
for ( int j = 0; j < image.cols; ++j)
{
// Do whatever you want
p[ j ] = 255.f * q[ j ] / 3.5f;
}
}