Skip to content

how to load data from cv::Mat #1495

Closed Answered by rygorous
bonne658 asked this question in Q&A
Jul 7, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

stb_image is used to load image files. PNG, JPG, BMP etc.

A cv::Mat is already an array of pixels in memory, which is the result of what stb_image would do, not the input to it. There's no loading step involved. You can just access the bytes in the cv::Mat directly (using ptr or other methods).

Either way, you seem to have a OpenCV question, not a stb_image question, so you'll have better odds of getting an answer there.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bonne658
Comment options

@rygorous
Comment options

@bonne658
Comment options

Answer selected by rygorous
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants