.. cpp:function:: void Mat::resize( size_t sz, const Scalar& s )
Changes the number of matrix rows.
:param sz: The new number of rows.
:param s: The value assigned to the newly added elements
The methods change the number of matrix rows. If the matrix is reallocated, the first ``min(Mat::rows, sz)`` rows are preserved. The methods emulates the corresponding methods of the STL vector class.
.. index:: Mat::reserve
Mat::reserve
---------------
.. cpp:function:: void Mat::reserve( size_t sz )
Reserves space for the certain number of rows
:param sz: The number of rows
The method changes the number of matrix rows. If the matrix is reallocated, the first ``min(Mat::rows, sz)`` rows are preserved. The method emulates the corresponding method of the STL vector class.
The methods reserves space for ``sz`` rows. If matrix already has space enough to store ``sz`` rows, nothing happens. If the matrix is reallocated, the first ``Mat::rows`` rows are preserved. The methods emulates the corresponding method of the STL vector class.
@@ -244,6 +244,16 @@ That is, the following code computes the execution time in seconds: ::
// do something ...
t = ((double)getTickCount() - t)/getTickFrequency();
.. index:: getCPUTickCount
getCPUTickCount
----------------
.. cpp:function:: int64 getCPUTickCount()
Returns the number of CPU ticks.
The function returns the current number of CPU ticks on some architectures (such as x86, x64, PowerPC). On other platforms the function is equivalent to ``getTickCount``. It can also be used for very accurate time measurements, as well as for RNG initialization. Note that in the case of multi-CPU systems a thread, from which ``getCPUTickCount`` is called, can be suspended and resumed at another CPU with its own counter, so in theory (and practice too) the subsequent calls to the function do not necessary return the monotonously increasing values. Also, since modern CPU vary the CPU frequency depending on the load, the number of CPU clocks spent in some code can not be directly converted to time units. Therefore, ``getTickCount`` is generally a preferable solution for measuring execution time.
.. index:: setNumThreads
setNumThreads
...
...
@@ -258,4 +268,28 @@ The function sets the number of threads used by OpenCV in parallel OpenMP region
:param onoff: The boolean flag, specifying whether the optimized code should be used (``onoff=true``) or not (``onoff=false``).
The function can be used to dynamically turn on and off optimized code (i.e. code that uses SSE2, AVX etc. instructions on the platforms that support it). It sets some global flag, which is further checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only safe to call the function on the very top level in your application, where you can be pretty much sure that no other OpenCV function is currently executed.
By default, the optimized code is enabled (unless you disable it in CMake). The current status can be retrieved using ``useOptimized``.
.. index:: useOptimized
useOptimized
-----------------
.. cpp:function:: bool useOptimized()
Returns status if the optimized code use
The function returns true if the optimized code is enabled, false otherwise.