Skip to content

Commit 3369961

Browse files
committed
Improve the documentation.
1 parent a212026 commit 3369961

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
1111
message(FATAL_ERROR "
1212
FATAL: In-source builds are not allowed.
13-
You should create separate directory for build files.
13+
You should create a separate directory for build files.
1414
")
1515
endif()
1616

@@ -263,7 +263,7 @@ OCV_OPTION(BUILD_PACKAGE "Enables 'make package_source' command"
263263
OCV_OPTION(BUILD_PERF_TESTS "Build performance tests" ON IF (NOT APPLE_FRAMEWORK) )
264264
OCV_OPTION(BUILD_TESTS "Build accuracy & regression tests" ON IF (NOT APPLE_FRAMEWORK) )
265265
OCV_OPTION(BUILD_WITH_DEBUG_INFO "Include debug info into debug libs (not MSCV only)" ON )
266-
OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for staticaly linked OpenCV" ON IF MSVC )
266+
OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of statically linked CRT for statically linked OpenCV" ON IF MSVC )
267267
OCV_OPTION(BUILD_WITH_DYNAMIC_IPP "Enables dynamic linking of IPP (only for standalone IPP)" OFF )
268268
OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
269269
OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID )

cmake/OpenCVUtils.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ macro(ocv_update VAR)
4848
endif()
4949
endmacro()
5050

51-
# Search packages for host system instead of packages for target system
52-
# in case of cross compilation thess macro should be defined by toolchain file
51+
# Search packages for the host system instead of packages for the target system
52+
# in case of cross compilation these macros should be defined by the toolchain file
5353
if(NOT COMMAND find_host_package)
5454
macro(find_host_package)
5555
find_package(${ARGN})
@@ -128,7 +128,7 @@ function(ocv_is_opencv_directory result_var dir)
128128
endfunction()
129129

130130

131-
# adds include directories in such way that directories from the OpenCV source tree go first
131+
# adds include directories in such a way that directories from the OpenCV source tree go first
132132
function(ocv_include_directories)
133133
ocv_debug_message("ocv_include_directories( ${ARGN} )")
134134
set(__add_before "")
@@ -162,7 +162,7 @@ function(ocv_append_dependant_targets target)
162162
set(OPENCV_DEPENDANT_TARGETS_${target} "${OPENCV_DEPENDANT_TARGETS_${target}};${ARGN}" CACHE INTERNAL "" FORCE)
163163
endfunction()
164164

165-
# adds include directories in such way that directories from the OpenCV source tree go first
165+
# adds include directories in such a way that directories from the OpenCV source tree go first
166166
function(ocv_target_include_directories target)
167167
#ocv_debug_message("ocv_target_include_directories(${target} ${ARGN})")
168168
_ocv_fix_target(target)
@@ -497,7 +497,7 @@ macro(ocv_check_modules define)
497497
endmacro()
498498

499499

500-
# Macros that checks if module have been installed.
500+
# Macro that checks if module has been installed.
501501
# After it adds module to build and define
502502
# constants passed as second arg
503503
macro(CHECK_MODULE module_name define cv_module)
@@ -656,7 +656,7 @@ macro(ocv_list_add_suffix LST SUFFIX)
656656
endmacro()
657657

658658

659-
# gets and removes the first element from list
659+
# gets and removes the first element from the list
660660
macro(ocv_list_pop_front LST VAR)
661661
if(${LST})
662662
list(GET ${LST} 0 ${VAR})

cmake/OpenCVVersion.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ set(OPENCV_VERSION "${OPENCV_VERSION_PLAIN}${OPENCV_VERSION_STATUS}")
1313
set(OPENCV_SOVERSION "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}")
1414
set(OPENCV_LIBVERSION "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
1515

16-
# create a dependency on version file
17-
# we never use output of the following command but cmake will rerun automatically if the version file changes
16+
# create a dependency on the version file
17+
# we never use the output of the following command but cmake will rerun automatically if the version file changes
1818
configure_file("${OPENCV_VERSION_FILE}" "${CMAKE_BINARY_DIR}/junk/version.junk" COPYONLY)
1919

2020
ocv_update(OPENCV_VS_VER_FILEVERSION_QUAD "${OPENCV_VERSION_MAJOR},${OPENCV_VERSION_MINOR},${OPENCV_VERSION_PATCH},0")

modules/core/include/opencv2/core/utility.hpp

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ If threads == 0, OpenCV will disable threading optimizations and run all it's fu
198198
sequentially. Passing threads \< 0 will reset threads number to system default. This function must
199199
be called outside of parallel region.
200200
201-
OpenCV will try to run it's functions with specified threads number, but some behaviour differs from
201+
OpenCV will try to run its functions with specified threads number, but some behaviour differs from
202202
framework:
203203
- `TBB` - User-defined parallel constructions will run with the same threads number, if
204-
another does not specified. If later on user creates own scheduler, OpenCV will use it.
204+
another is not specified. If later on user creates his own scheduler, OpenCV will use it.
205205
- `OpenMP` - No special defined behaviour.
206-
- `Concurrency` - If threads == 1, OpenCV will disable threading optimizations and run it's
206+
- `Concurrency` - If threads == 1, OpenCV will disable threading optimizations and run its
207207
functions sequentially.
208208
- `GCD` - Supports only values \<= 0.
209209
- `C=` - No special defined behaviour.
@@ -233,7 +233,7 @@ CV_EXPORTS_W int getNumThreads();
233233
/** @brief Returns the index of the currently executed thread within the current parallel region. Always
234234
returns 0 if called outside of parallel region.
235235
236-
The exact meaning of return value depends on the threading framework used by OpenCV library:
236+
The exact meaning of the return value depends on the threading framework used by OpenCV library:
237237
- `TBB` - Unsupported with current 4.1 TBB release. Maybe will be supported in future.
238238
- `OpenMP` - The thread number, within the current team, of the calling thread.
239239
- `Concurrency` - An ID for the virtual processor that the current context is executing on (0
@@ -285,6 +285,19 @@ tm.start();
285285
tm.stop();
286286
std::cout << tm.getTimeSec();
287287
@endcode
288+
289+
It is also possible to compute the average time over multiple runs:
290+
@code
291+
TickMeter tm;
292+
for (int i = 0; i < 100; i++)
293+
{
294+
tm.start();
295+
// do something ...
296+
tm.stop();
297+
}
298+
double average_time = tm.getTimeSec() / tm.getCounter();
299+
std::cout << "Average time in second per iteration is: " << average_time << std::endl;
300+
@endcode
288301
@sa getTickCount, getTickFrequency
289302
*/
290303

@@ -428,12 +441,13 @@ The function returns the aligned pointer of the same type as the input pointer:
428441
*/
429442
template<typename _Tp> static inline _Tp* alignPtr(_Tp* ptr, int n=(int)sizeof(_Tp))
430443
{
444+
CV_DbgAssert((n & (n - 1)) == 0); // n is a power of 2
431445
return (_Tp*)(((size_t)ptr + n-1) & -n);
432446
}
433447

434448
/** @brief Aligns a buffer size to the specified number of bytes.
435449
436-
The function returns the minimum number that is greater or equal to sz and is divisible by n :
450+
The function returns the minimum number that is greater than or equal to sz and is divisible by n :
437451
\f[\texttt{(sz + n-1) & -n}\f]
438452
@param sz Buffer size to align.
439453
@param n Alignment size that must be a power of two.
@@ -482,7 +496,7 @@ The function returns true if the optimized code is enabled. Otherwise, it return
482496
*/
483497
CV_EXPORTS_W bool useOptimized();
484498

485-
static inline size_t getElemSize(int type) { return CV_ELEM_SIZE(type); }
499+
static inline size_t getElemSize(int type) { return (size_t)CV_ELEM_SIZE(type); }
486500

487501
/////////////////////////////// Parallel Primitives //////////////////////////////////
488502

@@ -526,10 +540,10 @@ template<typename _Tp, typename Functor> inline
526540
void Mat::forEach_impl(const Functor& operation) {
527541
if (false) {
528542
operation(*reinterpret_cast<_Tp*>(0), reinterpret_cast<int*>(0));
529-
// If your compiler fail in this line.
543+
// If your compiler fails in this line.
530544
// Please check that your functor signature is
531-
// (_Tp&, const int*) <- multidimential
532-
// or (_Tp&, void*) <- in case of you don't need current idx.
545+
// (_Tp&, const int*) <- multi-dimensional
546+
// or (_Tp&, void*) <- in case you don't need current idx.
533547
}
534548

535549
CV_Assert(this->total() / this->size[this->dims - 1] <= INT_MAX);

0 commit comments

Comments
 (0)