Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

if you'd care to read the SFML docs (instead of cheesy SO posts), you'd have found it has getPixelsPtr () and getSize(), so it would be:

sf::image img = ...
sf::Vector2u siz = img.getSize();
uchar *pixels = img.getPixelsPtr();
cv::Mat mat(Size(siz.x, siz.y), CV_8UC4, pixels);

in your case, no, you cannot simply pass the address of the sf::image object !