Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

your second example is the only "correct" one.

in your first example, cv::Mat(7, 7, CV_8U) produces a Mat of the correct size, but the content (the "pixels", if you want) are left uninitialized, there can be anything in it.

an important difference between release and debug mode with VS is, that memory gets initialized to a consistent debug pattern in debug (something like cfcfcf, i forgot), but not so in release.

your second example is the only "correct" one.

in your first example, cv::Mat(7, 7, CV_8U) produces a Mat of the correct size, but the content (the "pixels", if you want) are left uninitialized, there can be anything anything in it.it, you simply get, whatever was in that part of memory before.

an important difference between release and debug mode with VS is, that memory gets initialized to a consistent debug pattern in debug (something like cfcfcf, i forgot), but not so in release.

your second example is the only "correct" one.

in your first example, cv::Mat(7, 7, CV_8U) produces a Mat of the correct size, but the content (the "pixels", if you want) are left uninitialized, there can be anything in it, you simply get, whatever was in that part of memory before.before (and yes, that may differ, if you run it from the ide or not)

an important difference between release and debug mode with VS is, that memory gets initialized to a consistent debug pattern in debug (something like cfcfcf, i forgot), but not so in release.