Skip to content

Instantly share code, notes, and snippets.

@walidvb
Created January 22, 2013 10:53
Show Gist options
  • Save walidvb/4593774 to your computer and use it in GitHub Desktop.
Save walidvb/4593774 to your computer and use it in GitHub Desktop.
transform Mat into Channel32f
//cv::imshow("", img.pixels);
Channel32f chan(img.width, img.height);
for(int i = 0; i < img.pixels.rows; i++)
{
for (int j = 0; j<img.pixels.cols; j++)
{
chan.setValue(ci::Vec2i(i, j), img.pixelAt(i, j));
}
}
Texture myImg;
myImg = Texture(chan);
draw(myImg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment