Revision history [back]

You've pretty much answered your own question. The CV_32FC1 mat type has a range from 1.17549e-38 to 3.40282e+38. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated.

And for what it's worth, if you use a fragment shader to do render to texture, you're not limited to values between 0 and 1.

You've pretty much answered your own question. The CV_32FC1 mat type has a range from 1.17549e-38 to 3.40282e+38. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated.rotate and swizzled.

And for what it's worth, if you use a fragment shader to do render to texture, you're not limited to values between 0 and 1.

You've pretty much answered your own question. The CV_32FC1 mat type has a range from 1.17549e-38 to 3.40282e+38. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotate rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render to texture, you're not limited to values between 0 and 1.

You've pretty much answered your own question. The CV_32FC1 mat type has a range from 1.17549e-38 to 3.40282e+38. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render to texture, you're not limited to values between 0 and 1.1. I'm sure it's the same with compute shaders.

You've pretty much answered your own question. The CV_32FC1 mat type has a range from 1.17549e-38 to 3.40282e+38. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render to texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

You've pretty much answered your own question. The CV_32FC1 mat Mat type has a range from 1.17549e-38 to 3.40282e+38. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render to texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

You've pretty much answered your own question. The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render to texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render to texture, render-to-texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38. 3.40282e+38 (I got these values from std::numeric_limits<float>. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>. std::numeric_limits < float >. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill regions in your image and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

The CV_32FC1 CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits < float >. std::numeric_limits<float>. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 255 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>. If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 255 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>. ). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, so I'll have to take your word for it that would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D, glTexImage2D(), so I'll have to take your word for it that it would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. I'm sure it's the same with compute shaders.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D(), so I'll have to take your word for it that it would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. I'm sure it's It's the same with compute shaders.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D(), so I'll have to take your word for it that it would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. It's the same with compute shaders.shaders. It's only when you render-to-screen that you want to make sure that your values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D(), so I'll have to take your word for it that it would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render-to-screen that you want to make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D(), so I'll have to take your word for it that it would come out rotated and swizzled.

And for what it's worth, if you use a fragment shader to do render-to-texture, render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render-to-screen render to screen that you want to make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D(), so I'll have to take your word for it that it would come out rotated and swizzled.

And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D(), so I'll have to take your word for it that it would come out rotated and swizzled.

And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never tried passing a Mat raw pointer to glTexImage2D(), so I'll have to take your word for it that it would come out rotated and swizzled.swizzled. If you experiment with this, and find that you are right, then you should write up an answer. I'd vote for it.

And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I've never I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), so I'll have to take your word for and it that it would come out rotated and swizzled. If you experiment with this, and find that you are right, then you should write up an answer. I'd vote for it.works quite well (no rotation or swizzling of the image) using the following code:

image = cv::imread("dot.png");

...

glGenTextures( 1, &mTextureID );
glBindTexture( GL_TEXTURE_2D, mTextureID );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data );


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well (no rotation or swizzling of the image) using the following code:

image = cv::imread("dot.png");

...

glGenTextures( 1, &mTextureID );
glBindTexture( GL_TEXTURE_2D, mTextureID );
glTexImage2D( GL_TEXTURE_2D, glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data );
image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well (no rotation or swizzling of the image) using the following code:

Mat image = cv::imread("dot.png");

...

glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well (no rotation or swizzling of the image) using the following code:

Mat image = cv::imread("dot.png");

glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well (no rotation or swizzling of the image) image as naively expected) using the following code:

Mat image = imread("dot.png");

glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well (no rotation or swizzling of the image as I had naively expected) using the following code:

Mat image = imread("dot.png");

glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well (no rotation or swizzling of the image as I had naively expected) using the following code:

Mat image = imread("dot.png");
glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well (no rotation or swizzling of the image as I had naively expected) using the following code:expected):

Mat image = imread("dot.png");
glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well (no -- no rotation or swizzling of the image as I had naively expected):occurs:

Mat image = imread("dot.png");
glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well -- no rotation or swizzling of the image occurs:

Mat image = imread("dot.png");
cvtColor(image, image, CV_RGB2BGR);
glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.

The CV_32FC1 Mat type has a range from 1.17549e-38 to 3.40282e+38 (I got these values from std::numeric_limits<float>). If the value is less than 0, it is shown as black. If the value is greater than 1, it is shown as white. This all comes in handy when you want to flood fill all of the regions in your image with a unique colour, and you have more than 65536 regions to contend with.

I just tried passing a Mat raw pointer (using the .data member variable) to glTexImage2D(), and it works quite well -- no rotation or swizzling of the image occurs:

Mat image = imread("dot.png");
cvtColor(image, image, CV_RGB2BGR);
CV_BGR2RGB);
glGenTextures(1, &tex_id);
glBindTexture(GL_TEXTURE_2D, tex_id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.cols, image.rows, 0, GL_RGB, GL_UNSIGNED_BYTE, image.data);


And for what it's worth, if you use a vertex + fragment shader to do render to texture, you're not limited to output values between 0 and 1. It's the same with compute shaders. It's only when you render to screen that you want to play nice and make sure that your output values are normalized.