Ask Your Question

Revision history [back]

This is intentional to the design. See the tutorial Mat - The Basic Image Container.

The content of the Mat header is not modified, including the pointer to the data content array. The content itself may be modified, even though the header is const.

This is intentional to the design. See the tutorial Mat - The Basic Image Container.

Const is a promise that the elements of the referenced data will not be modified. This is upheld.

The Mat header includes a pointer to the data array. No part of the header is modified. The content of the Mat data array that the header points to is modified. That is not modified, including the pointer part of what is promised to the data content array. The content itself may be modified, even though the header is const.remain constant.

This is intentional to the design. See the tutorial Mat - The Basic Image Container.

Const is a promise that the elements of the referenced data will not be modified. This is upheld.

upheld. The Mat header includes a pointer to the data array. No part of the header is modified. modified.

The content of the data array that the header points to is modified. That is not part of what is promised to remain constant.constant. It cannot be protected using const Mat.

This Sharing the content data array between several Mat headers is intentional to the design. design of OpenCV. See the tutorial Mat - The Basic Image Container.

Const is a promise that the elements of the referenced data will not be modified. This is upheld. The Mat header includes a pointer to the data array. No part of the header is modified.

The content of the data array that the header points to is modified. That is not part of what is promised to remain constant. It cannot be protected using const Mat.

It's a parameter type declaration, not a constructor. In the putText function, the Mat header is unchanged. Only the data pointed to by the Mat data is changed. So, the Mat header is constant.

Sharing the content data array between several Mat headers is intentional to the design of OpenCV. See the tutorial Mat - The Basic Image Container.

Const is a promise that the elements of the referenced data will not be modified. This is upheld. The Mat header includes a pointer to the data array. No part of the header is modified.

The content of the data array that the header points to is modified. That is not part of what is promised to remain constant. It cannot be protected using const Mat.