mirror of
https://github.com/opencv/opencv.git
synced 2025-07-30 09:16:50 +08:00
Merge remote-tracking branch 'refs/remotes/opencv/master' into FileStorageJSON
This commit is contained in:
commit
26a8c45e23
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@ -1,6 +1,6 @@
|
||||
<!--
|
||||
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
|
||||
If you need further assistance please read [How To Contribute](https://github.com/Itseez/opencv/wiki/How_to_contribute).
|
||||
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).
|
||||
|
||||
This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
|
||||
-->
|
||||
|
4
3rdparty/carotene/src/resize.cpp
vendored
4
3rdparty/carotene/src/resize.cpp
vendored
@ -432,7 +432,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
vSum = vaddq_u16(vSum, vaddl_u8(vLane4.val[0], vLane4.val[1]));
|
||||
vSum = vaddq_u16(vSum, vaddl_u8(vLane4.val[2], vLane4.val[3]));
|
||||
|
||||
vst1_u8(dst_row + dj, areaDownsamplingDivision<opencv_like,4>(vSum));
|
||||
vst1_u8(dst_row + dj, (areaDownsamplingDivision<opencv_like,4>(vSum)));
|
||||
}
|
||||
|
||||
for ( ; dj < dsize.width; ++dj, sj += 4)
|
||||
@ -706,7 +706,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
uint16x8_t v_sum = vcombine_u16(vadd_u16(vget_low_u16(v_sum0), vget_high_u16(v_sum0)),
|
||||
vadd_u16(vget_low_u16(v_sum1), vget_high_u16(v_sum1)));
|
||||
|
||||
vst1_u8(dst_row + dj, areaDownsamplingDivision<opencv_like,4>(v_sum));
|
||||
vst1_u8(dst_row + dj, (areaDownsamplingDivision<opencv_like,4>(v_sum)));
|
||||
}
|
||||
|
||||
for (size_t dwidth = dsize.width << 2; dj < dwidth; dj += 4, sj += 16)
|
||||
|
14
3rdparty/ffmpeg/ffmpeg.cmake
vendored
14
3rdparty/ffmpeg/ffmpeg.cmake
vendored
@ -1,11 +1,11 @@
|
||||
# Binary branch name: ffmpeg/master_20150703
|
||||
# Binaries were created for OpenCV: e379ea6ed60b0caad4d4e3eea096e9d850cb8c86
|
||||
set(FFMPEG_BINARIES_COMMIT "8aeefc4efe3215de89d8c7e114ae6f7a6091b8eb")
|
||||
set(FFMPEG_FILE_HASH_BIN32 "89c783eee1c47bfc733f08334ec2e31c")
|
||||
set(FFMPEG_FILE_HASH_BIN64 "35fe6ccdda6d7a04e9056b0d73b98e76")
|
||||
set(FFMPEG_FILE_HASH_CMAKE "8606f947a780071f8fcce8cbf39ceef5")
|
||||
# Binary branch name: ffmpeg/master_20160715
|
||||
# Binaries were created for OpenCV: 0e6aa189cb9a9642b0ae7983d301693516faad5d
|
||||
set(FFMPEG_BINARIES_COMMIT "7eef9080d3271c7547d303fa839a62e1124ff1e6")
|
||||
set(FFMPEG_FILE_HASH_BIN32 "3bb2a8388af90adf6c762210e696400d")
|
||||
set(FFMPEG_FILE_HASH_BIN64 "ebcfc963f0a94f7e83d58d60eaf23849")
|
||||
set(FFMPEG_FILE_HASH_CMAKE "f99941d10c1e87bf16b9055e8fc91ab2")
|
||||
|
||||
set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/Itseez/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)
|
||||
set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)
|
||||
|
||||
ocv_download(PACKAGE opencv_ffmpeg.dll
|
||||
HASH ${FFMPEG_FILE_HASH_BIN32}
|
||||
|
2
3rdparty/ippicv/downloader.cmake
vendored
2
3rdparty/ippicv/downloader.cmake
vendored
@ -64,7 +64,7 @@ function(_icv_downloader)
|
||||
if(DEFINED ENV{OPENCV_ICV_URL})
|
||||
set(OPENCV_ICV_URL $ENV{OPENCV_ICV_URL})
|
||||
else()
|
||||
set(OPENCV_ICV_URL "https://raw.githubusercontent.com/Itseez/opencv_3rdparty/${IPPICV_BINARIES_COMMIT}/ippicv")
|
||||
set(OPENCV_ICV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_BINARIES_COMMIT}/ippicv")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -164,6 +164,8 @@ endif()
|
||||
# OpenCV cmake options
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
OCV_OPTION(OPENCV_ENABLE_NONFREE "Enable non-free algorithms" OFF)
|
||||
|
||||
# Optional 3rd party components
|
||||
# ===================================================
|
||||
OCV_OPTION(WITH_1394 "Include IEEE1394 support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
@ -191,6 +193,7 @@ OCV_OPTION(WITH_OPENGL "Include OpenGL support" OFF
|
||||
OCV_OPTION(WITH_OPENNI "Include OpenNI support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_OPENNI2 "Include OpenNI2 support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_PNG "Include PNG support" ON)
|
||||
OCV_OPTION(WITH_GDCM "Include DICOM support" OFF)
|
||||
OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
@ -221,7 +224,7 @@ OCV_OPTION(WITH_VA "Include VA support" OFF
|
||||
OCV_OPTION(WITH_VA_INTEL "Include Intel VA-API/OpenCL support" OFF IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
|
||||
OCV_OPTION(WITH_GPHOTO2 "Include gPhoto2 library support" ON IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_LAPACK "Include Lapack library support" ON IF (UNIX AND NOT ANDROID) )
|
||||
OCV_OPTION(WITH_LAPACK "Include Lapack library support" ON IF (NOT ANDROID) )
|
||||
|
||||
# OpenCV build components
|
||||
# ===================================================
|
||||
@ -913,6 +916,11 @@ status(" Disabled:" OPENCV_MODULES_DISABLED_USER THEN ${OPENCV
|
||||
status(" Disabled by dependency:" OPENCV_MODULES_DISABLED_AUTO THEN ${OPENCV_MODULES_DISABLED_AUTO_ST} ELSE "-")
|
||||
status(" Unavailable:" OPENCV_MODULES_DISABLED_FORCE THEN ${OPENCV_MODULES_DISABLED_FORCE_ST} ELSE "-")
|
||||
|
||||
if(OPENCV_ENABLE_NONFREE)
|
||||
status("")
|
||||
status(" Non-free algorithms are enabled")
|
||||
endif()
|
||||
|
||||
# ========================== Android details ==========================
|
||||
if(ANDROID)
|
||||
status("")
|
||||
@ -1008,6 +1016,7 @@ if(WITH_PNG)
|
||||
else()
|
||||
status(" PNG:" "NO")
|
||||
endif()
|
||||
|
||||
if(WITH_TIFF)
|
||||
if(TIFF_VERSION_STRING AND TIFF_FOUND)
|
||||
status(" TIFF:" "${TIFF_LIBRARY} (ver ${TIFF_VERSION} - ${TIFF_VERSION_STRING})")
|
||||
@ -1034,6 +1043,12 @@ else()
|
||||
status(" GDAL:" "NO")
|
||||
endif()
|
||||
|
||||
if(WITH_GDCM)
|
||||
status(" GDCM:" GDCM_FOUND THEN "YES (ver ${GDCM_VERSION})" ELSE "NO")
|
||||
else()
|
||||
status(" GDCM:" "NO")
|
||||
endif()
|
||||
|
||||
# ========================== VIDEO IO ==========================
|
||||
status("")
|
||||
status(" Video I/O:")
|
||||
|
@ -1,3 +1,3 @@
|
||||
## Contributing guidelines
|
||||
|
||||
All guidelines for contributing to the OpenCV repository can be found at [`How to contribute guideline`](https://github.com/Itseez/opencv/wiki/How_to_contribute).
|
||||
All guidelines for contributing to the OpenCV repository can be found at [`How to contribute guideline`](https://github.com/opencv/opencv/wiki/How_to_contribute).
|
||||
|
@ -5,11 +5,11 @@
|
||||
* Homepage: <http://opencv.org>
|
||||
* Docs: <http://docs.opencv.org/master/>
|
||||
* Q&A forum: <http://answers.opencv.org>
|
||||
* Issue tracking: <https://github.com/Itseez/opencv/issues>
|
||||
* Issue tracking: <https://github.com/opencv/opencv/issues>
|
||||
|
||||
#### Contributing
|
||||
|
||||
Please read before starting work on a pull request: <https://github.com/Itseez/opencv/wiki/How_to_contribute>
|
||||
Please read before starting work on a pull request: <https://github.com/opencv/opencv/wiki/How_to_contribute>
|
||||
|
||||
Summary of guidelines:
|
||||
|
||||
|
@ -5,3 +5,4 @@ add_subdirectory(traincascade)
|
||||
add_subdirectory(createsamples)
|
||||
add_subdirectory(annotation)
|
||||
add_subdirectory(visualisation)
|
||||
add_subdirectory(interactive-calibration)
|
||||
|
@ -224,29 +224,30 @@ vector<Rect> get_annotations(Mat input_image)
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
{
|
||||
// If no arguments are given, then supply some information on how this tool works
|
||||
if( argc == 1 ){
|
||||
cout << "Usage: " << argv[0] << endl;
|
||||
cout << " -images <folder_location> [example - /data/testimages/]" << endl;
|
||||
cout << " -annotations <ouput_file> [example - /data/annotations.txt]" << endl;
|
||||
cout << "TIP: Use absolute paths to avoid any problems with the software!" << endl;
|
||||
// Use the cmdlineparser to process input arguments
|
||||
CommandLineParser parser(argc, argv,
|
||||
"{ help h usage ? | | show this message }"
|
||||
"{ images i | | (required) path to image folder [example - /data/testimages/] }"
|
||||
"{ annotations a | | (required) path to annotations txt file [example - /data/annotations.txt] }"
|
||||
"{ maxWindowHeight m | -1 | (optional) images larger in height than this value will be scaled down }"
|
||||
"{ resizeFactor r | 2 | (optional) factor for scaling down [default = half the size] }"
|
||||
);
|
||||
// Read in the input arguments
|
||||
if (parser.has("help")){
|
||||
parser.printMessage();
|
||||
cerr << "TIP: Use absolute paths to avoid any problems with the software!" << endl;
|
||||
return 0;
|
||||
}
|
||||
string image_folder(parser.get<string>("images"));
|
||||
string annotations_file(parser.get<string>("annotations"));
|
||||
if (image_folder.empty() || annotations_file.empty()){
|
||||
parser.printMessage();
|
||||
cerr << "TIP: Use absolute paths to avoid any problems with the software!" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Read in the input arguments
|
||||
string image_folder;
|
||||
string annotations_file;
|
||||
for(int i = 1; i < argc; ++i )
|
||||
{
|
||||
if( !strcmp( argv[i], "-images" ) )
|
||||
{
|
||||
image_folder = argv[++i];
|
||||
}
|
||||
else if( !strcmp( argv[i], "-annotations" ) )
|
||||
{
|
||||
annotations_file = argv[++i];
|
||||
}
|
||||
}
|
||||
int resizeFactor = parser.get<int>("resizeFactor");
|
||||
int const maxWindowHeight = parser.get<int>("maxWindowHeight") > 0 ? parser.get<int>("maxWindowHeight") : -1;
|
||||
|
||||
// Check if the folder actually exists
|
||||
// If -1 is returned then the folder actually exists, and thus you can continue
|
||||
@ -282,6 +283,7 @@ int main( int argc, const char** argv )
|
||||
for (size_t i = 0; i < filenames.size(); i++){
|
||||
// Read in an image
|
||||
Mat current_image = imread(filenames[i]);
|
||||
bool const resize_bool = (maxWindowHeight > 0) && (current_image.rows > maxWindowHeight);
|
||||
|
||||
// Check if the image is actually read - avoid other files in the folder, because glob() takes them all
|
||||
// If not then simply skip this iteration
|
||||
@ -289,8 +291,21 @@ int main( int argc, const char** argv )
|
||||
continue;
|
||||
}
|
||||
|
||||
if(resize_bool){
|
||||
resize(current_image, current_image, Size(current_image.cols/resizeFactor, current_image.rows/resizeFactor));
|
||||
}
|
||||
|
||||
// Perform annotations & store the result inside the vectorized structure
|
||||
// If the image was resized before, then resize the found annotations back to original dimensions
|
||||
vector<Rect> current_annotations = get_annotations(current_image);
|
||||
if(resize_bool){
|
||||
for(int j =0; j < (int)current_annotations.size(); j++){
|
||||
current_annotations[j].x = current_annotations[j].x * resizeFactor;
|
||||
current_annotations[j].y = current_annotations[j].y * resizeFactor;
|
||||
current_annotations[j].width = current_annotations[j].width * resizeFactor;
|
||||
current_annotations[j].height = current_annotations[j].height * resizeFactor;
|
||||
}
|
||||
}
|
||||
annotations.push_back(current_annotations);
|
||||
|
||||
// Check if the ESC key was hit, then exit earlier then expected
|
||||
|
@ -76,6 +76,7 @@ int main( int argc, char* argv[] )
|
||||
double scale = 4.0;
|
||||
int width = 24;
|
||||
int height = 24;
|
||||
double maxscale = -1.0;
|
||||
|
||||
srand((unsigned int)time(0));
|
||||
|
||||
@ -92,9 +93,10 @@ int main( int argc, char* argv[] )
|
||||
" [-maxyangle <max_y_rotation_angle = %f>]\n"
|
||||
" [-maxzangle <max_z_rotation_angle = %f>]\n"
|
||||
" [-show [<scale = %f>]]\n"
|
||||
" [-w <sample_width = %d>]\n [-h <sample_height = %d>]\n",
|
||||
" [-w <sample_width = %d>]\n [-h <sample_height = %d>]\n"
|
||||
" [-maxscale <max sample scale = %f>]\n",
|
||||
argv[0], num, bgcolor, bgthreshold, maxintensitydev,
|
||||
maxxangle, maxyangle, maxzangle, scale, width, height );
|
||||
maxxangle, maxyangle, maxzangle, scale, width, height, maxscale );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -172,6 +174,10 @@ int main( int argc, char* argv[] )
|
||||
{
|
||||
height = atoi( argv[++i] );
|
||||
}
|
||||
else if( !strcmp( argv[i], "-maxscale" ) )
|
||||
{
|
||||
maxscale = atof( argv[++i] );
|
||||
}
|
||||
}
|
||||
|
||||
printf( "Info file name: %s\n", ((infoname == NULL) ? nullname : infoname ) );
|
||||
@ -194,6 +200,7 @@ int main( int argc, char* argv[] )
|
||||
}
|
||||
printf( "Width: %d\n", width );
|
||||
printf( "Height: %d\n", height );
|
||||
printf( "Max Scale: %g\n", maxscale);
|
||||
|
||||
/* determine action */
|
||||
if( imagename && vecname )
|
||||
@ -213,7 +220,7 @@ int main( int argc, char* argv[] )
|
||||
|
||||
cvCreateTestSamples( infoname, imagename, bgcolor, bgthreshold, bgfilename, num,
|
||||
invert, maxintensitydev,
|
||||
maxxangle, maxyangle, maxzangle, showsamples, width, height );
|
||||
maxxangle, maxyangle, maxzangle, showsamples, width, height, maxscale);
|
||||
|
||||
printf( "Done\n" );
|
||||
}
|
||||
|
@ -38,7 +38,6 @@
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
|
||||
@ -1308,7 +1307,7 @@ void cvCreateTestSamples( const char* infoname,
|
||||
int invert, int maxintensitydev,
|
||||
double maxxangle, double maxyangle, double maxzangle,
|
||||
int showsamples,
|
||||
int winwidth, int winheight )
|
||||
int winwidth, int winheight, double maxscale )
|
||||
{
|
||||
CvSampleDistortionData data;
|
||||
|
||||
@ -1337,7 +1336,6 @@ void cvCreateTestSamples( const char* infoname,
|
||||
int i;
|
||||
int x, y, width, height;
|
||||
float scale;
|
||||
float maxscale;
|
||||
int inverse;
|
||||
|
||||
if( showsamples )
|
||||
@ -1366,12 +1364,16 @@ void cvCreateTestSamples( const char* infoname,
|
||||
for( i = 0; i < count; i++ )
|
||||
{
|
||||
icvGetNextFromBackgroundData( cvbgdata, cvbgreader );
|
||||
|
||||
maxscale = MIN( 0.7F * cvbgreader->src.cols / winwidth,
|
||||
if( maxscale < 0.0 )
|
||||
{
|
||||
maxscale = MIN( 0.7F * cvbgreader->src.cols / winwidth,
|
||||
0.7F * cvbgreader->src.rows / winheight );
|
||||
}
|
||||
|
||||
if( maxscale < 1.0F ) continue;
|
||||
|
||||
scale = (maxscale - 1.0F) * rand() / RAND_MAX + 1.0F;
|
||||
scale = ((float)maxscale - 1.0F) * rand() / RAND_MAX + 1.0F;
|
||||
|
||||
width = (int) (scale * winwidth);
|
||||
height = (int) (scale * winheight);
|
||||
x = (int) ((0.1+0.8 * rand()/RAND_MAX) * (cvbgreader->src.cols - width));
|
||||
|
@ -86,7 +86,7 @@ void cvCreateTestSamples( const char* infoname,
|
||||
int invert, int maxintensitydev,
|
||||
double maxxangle, double maxyangle, double maxzangle,
|
||||
int showsamples,
|
||||
int winwidth, int winheight );
|
||||
int winwidth, int winheight, double maxscale );
|
||||
|
||||
/*
|
||||
* cvCreateTrainingSamplesFromInfo
|
||||
|
@ -23,7 +23,7 @@ const std::string keys =
|
||||
"{v | | Input from video file }"
|
||||
"{ci | 0 | Default camera id }"
|
||||
"{flip | false | Vertical flip of input frames }"
|
||||
"{t | circles | Template for calibration (circles, chessboard, dualCircles, chAruco) }"
|
||||
"{t | circles | Template for calibration (circles, chessboard, dualCircles, charuco) }"
|
||||
"{sz | 16.3 | Distance between two nearest centers of circles or squares on calibration board}"
|
||||
"{dst | 295 | Distance between white and black parts of daulCircles template}"
|
||||
"{w | | Width of template (in corners or circles)}"
|
||||
|
@ -310,7 +310,8 @@ bool CvCascadeClassifier::updateTrainingSet( double minimumAcceptanceRatio, doub
|
||||
int proNumNeg = cvRound( ( ((double)numNeg) * ((double)posCount) ) / numPos ); // apply only a fraction of negative samples. double is required since overflow is possible
|
||||
int negCount = fillPassedSamples( posCount, proNumNeg, false, minimumAcceptanceRatio, negConsumed );
|
||||
if ( !negCount )
|
||||
return false;
|
||||
if ( !(negConsumed > 0 && ((double)negCount+1)/(double)negConsumed <= minimumAcceptanceRatio) )
|
||||
return false;
|
||||
|
||||
curNumSamples = posCount + negCount;
|
||||
acceptanceRatio = negConsumed == 0 ? 0 : ( (double)negCount/(double)(int64)negConsumed );
|
||||
|
@ -49,13 +49,6 @@ understanding of the used features.
|
||||
USAGE:
|
||||
./opencv_visualisation --model=<model.xml> --image=<ref.png> --data=<video output folder>
|
||||
|
||||
LIMITS
|
||||
- Use an absolute path for the output folder to ensure the tool works
|
||||
- Only handles cascade classifier models
|
||||
- Handles stumps only for the moment
|
||||
- Needs a valid training/test sample window with the original model dimensions, passed as `ref.png`
|
||||
- Can handle HAAR and LBP features
|
||||
|
||||
Created by: Puttemans Steven - April 2016
|
||||
*****************************************************************************************************/
|
||||
|
||||
@ -79,6 +72,13 @@ struct rect_data{
|
||||
float weight;
|
||||
};
|
||||
|
||||
static void printLimits(){
|
||||
cerr << "Limits of the current interface:" << endl;
|
||||
cerr << " - Only handles cascade classifier models, trained with the opencv_traincascade tool, containing stumps as decision trees [default settings]." << endl;
|
||||
cerr << " - The image provided needs to be a sample window with the original model dimensions, passed to the --image parameter." << endl;
|
||||
cerr << " - ONLY handles HAAR and LBP features." << endl;
|
||||
}
|
||||
|
||||
int main( int argc, const char** argv )
|
||||
{
|
||||
CommandLineParser parser(argc, argv,
|
||||
@ -90,6 +90,7 @@ int main( int argc, const char** argv )
|
||||
// Read in the input arguments
|
||||
if (parser.has("help")){
|
||||
parser.printMessage();
|
||||
printLimits();
|
||||
return 0;
|
||||
}
|
||||
string model(parser.get<string>("model"));
|
||||
@ -97,6 +98,7 @@ int main( int argc, const char** argv )
|
||||
string image_ref = (parser.get<string>("image"));
|
||||
if (model.empty() || image_ref.empty()){
|
||||
parser.printMessage();
|
||||
printLimits();
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -146,8 +146,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
elseif(X86 OR X86_64)
|
||||
add_extra_compiler_option(-mno-sse2)
|
||||
endif()
|
||||
if(ARM)
|
||||
add_extra_compiler_option("-mfp16-format=ieee")
|
||||
endif(ARM)
|
||||
if(ENABLE_NEON)
|
||||
add_extra_compiler_option("-mfpu=neon")
|
||||
add_extra_compiler_option("-mfpu=neon-fp16")
|
||||
endif()
|
||||
if(ENABLE_VFPV3 AND NOT ENABLE_NEON)
|
||||
add_extra_compiler_option("-mfpu=vfpv3")
|
||||
@ -366,3 +369,18 @@ if(MSVC)
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4589) # Constructor of abstract class 'cv::ORB' ignores initializer for virtual base class 'cv::Algorithm'
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT OPENCV_FP16_DISABLE)
|
||||
try_compile(__VALID_FP16
|
||||
"${OpenCV_BINARY_DIR}"
|
||||
"${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp"
|
||||
COMPILE_DEFINITIONS "-DCHECK_FP16"
|
||||
OUTPUT_VARIABLE TRY_OUT
|
||||
)
|
||||
if(NOT __VALID_FP16)
|
||||
message(STATUS "FP16: Compiler support is not available")
|
||||
else()
|
||||
message(STATUS "FP16: Compiler support is available")
|
||||
set(HAVE_FP16 1)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -75,10 +75,10 @@ if(NOT ${found})
|
||||
|
||||
if(NOT ANDROID AND NOT APPLE_FRAMEWORK)
|
||||
ocv_check_environment_variables(${library_env} ${include_dir_env})
|
||||
if(NOT ${${library_env}} EQUAL "")
|
||||
if(NOT ${${library_env}} STREQUAL "")
|
||||
set(PYTHON_LIBRARY "${${library_env}}")
|
||||
endif()
|
||||
if(NOT ${${include_dir_env}} EQUAL "")
|
||||
if(NOT ${${include_dir_env}} STREQUAL "")
|
||||
set(PYTHON_INCLUDE_DIR "${${include_dir_env}}")
|
||||
endif()
|
||||
|
||||
@ -162,10 +162,10 @@ if(NOT ${found})
|
||||
message(STATUS "Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)")
|
||||
message(STATUS "If you want to enable Python/Numpy support, set the following variables:")
|
||||
message(STATUS " PYTHON2_INCLUDE_PATH")
|
||||
message(STATUS " PYTHON2_LIBRARIES")
|
||||
message(STATUS " PYTHON2_LIBRARIES (optional on Unix-like systems)")
|
||||
message(STATUS " PYTHON2_NUMPY_INCLUDE_DIRS")
|
||||
message(STATUS " PYTHON3_INCLUDE_PATH")
|
||||
message(STATUS " PYTHON3_LIBRARIES")
|
||||
message(STATUS " PYTHON3_LIBRARIES (optional on Unix-like systems)")
|
||||
message(STATUS " PYTHON3_NUMPY_INCLUDE_DIRS")
|
||||
else()
|
||||
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
|
||||
|
@ -212,3 +212,15 @@ if(WITH_GDAL)
|
||||
ocv_include_directories(${GDAL_INCLUDE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WITH_GDCM)
|
||||
find_package(GDCM)
|
||||
if(NOT GDCM_FOUND)
|
||||
set(HAVE_GDCM NO)
|
||||
ocv_clear_vars(GDCM_VERSION GDCM_LIBRARIES)
|
||||
else()
|
||||
set(HAVE_GDCM YES)
|
||||
# include(${GDCM_USE_FILE})
|
||||
set(GDCM_LIBRARIES gdcmMSFF) # GDCM does not set this variable for some reason
|
||||
endif()
|
||||
endif()
|
||||
|
@ -7,11 +7,21 @@ if(WITH_LAPACK)
|
||||
find_package(LAPACK)
|
||||
if(LAPACK_FOUND)
|
||||
find_path(LAPACKE_INCLUDE_DIR "lapacke.h")
|
||||
if(LAPACKE_INCLUDE_DIR)
|
||||
find_path(MKL_LAPACKE_INCLUDE_DIR "mkl_lapack.h")
|
||||
if(LAPACKE_INCLUDE_DIR OR MKL_LAPACKE_INCLUDE_DIR)
|
||||
find_path(CBLAS_INCLUDE_DIR "cblas.h")
|
||||
if(CBLAS_INCLUDE_DIR)
|
||||
find_path(MKL_CBLAS_INCLUDE_DIR "mkl_cblas.h")
|
||||
|
||||
if(CBLAS_INCLUDE_DIR OR MKL_CBLAS_INCLUDE_DIR)
|
||||
set(HAVE_LAPACK 1)
|
||||
|
||||
if(CBLAS_INCLUDE_DIR)
|
||||
ocv_include_directories(${LAPACKE_INCLUDE_DIR} ${CBLAS_INCLUDE_DIR})
|
||||
set(HAVE_LAPACK_GENERIC 1)
|
||||
elseif(MKL_CBLAS_INCLUDE_DIR)
|
||||
ocv_include_directories(${MKL_LAPACKE_INCLUDE_DIR} ${MKL_CBLAS_INCLUDE_DIR})
|
||||
set(HAVE_LAPACK_MKL 1)
|
||||
endif()
|
||||
list(APPEND OPENCV_LINKER_LIBS ${LAPACK_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
33
cmake/checks/fp16.cpp
Normal file
33
cmake/checks/fp16.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined __F16C__ || (defined _MSC_VER && _MSC_VER >= 1700)
|
||||
#include <immintrin.h>
|
||||
int test()
|
||||
{
|
||||
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
short dst[8];
|
||||
__m128 v_src = _mm_load_ps(src);
|
||||
__m128i v_dst = _mm_cvtps_ph(v_src, 0);
|
||||
_mm_storel_epi64((__m128i*)dst, v_dst);
|
||||
return (int)dst[0];
|
||||
}
|
||||
#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
|
||||
#include "arm_neon.h"
|
||||
int test()
|
||||
{
|
||||
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f };
|
||||
short dst[8];
|
||||
float32x4_t v_src = *(float32x4_t*)src;
|
||||
float16x4_t v_dst = vcvt_f16_f32(v_src);
|
||||
*(float16x4_t*)dst = v_dst;
|
||||
return (int)dst[0];
|
||||
}
|
||||
#else
|
||||
#error "FP16 is not supported"
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("%d\n", test());
|
||||
return 0;
|
||||
}
|
@ -111,6 +111,9 @@
|
||||
/* libpng/png.h needs to be included */
|
||||
#cmakedefine HAVE_LIBPNG_PNG_H
|
||||
|
||||
/* GDCM DICOM codec */
|
||||
#cmakedefine HAVE_GDCM
|
||||
|
||||
/* V4L/V4L2 capturing support via libv4l */
|
||||
#cmakedefine HAVE_LIBV4L
|
||||
|
||||
@ -200,3 +203,12 @@
|
||||
|
||||
/* Lapack */
|
||||
#cmakedefine HAVE_LAPACK
|
||||
|
||||
/* Lapack Generic */
|
||||
#cmakedefine HAVE_LAPACK_GENERIC
|
||||
|
||||
/* Lapack MKL */
|
||||
#cmakedefine HAVE_LAPACK_MKL
|
||||
|
||||
/* FP16 */
|
||||
#cmakedefine HAVE_FP16
|
||||
|
@ -6,4 +6,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// This definition means that OpenCV is built with enabled non-free code.
|
||||
// For example, patented algorithms for non-profit/non-commercial use only.
|
||||
#cmakedefine OPENCV_ENABLE_NONFREE
|
||||
|
||||
@OPENCV_MODULE_DEFINITIONS_CONFIGMAKE@
|
||||
|
@ -150,7 +150,7 @@ BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
GENERATE_QHP = @CMAKE_DOXYGEN_GENERATE_QHP@
|
||||
QCH_FILE = ../opencv-@OPENCV_VERSION@.qch
|
||||
QHP_NAMESPACE = org.itseez.opencv.@OPENCV_VERSION@
|
||||
QHP_NAMESPACE = org.opencv.@OPENCV_VERSION@
|
||||
QHP_VIRTUAL_FOLDER = opencv
|
||||
QHP_CUST_FILTER_NAME =
|
||||
QHP_CUST_FILTER_ATTRS =
|
||||
|
@ -750,7 +750,7 @@
|
||||
organization = {ACM}
|
||||
}
|
||||
@INPROCEEDINGS{Viola01,
|
||||
author = {Viola, Paul and Jones, Michael},
|
||||
author = {Viola, Paul and Jones, Michael J.},
|
||||
title = {Rapid object detection using a boosted cascade of simple features},
|
||||
booktitle = {Computer Vision and Pattern Recognition, 2001. CVPR 2001. Proceedings of the 2001 IEEE Computer Society Conference on},
|
||||
year = {2001},
|
||||
@ -758,6 +758,16 @@
|
||||
volume = {1},
|
||||
organization = {IEEE}
|
||||
}
|
||||
@ARTICLE{Viola04,
|
||||
author = {Viola, Paul and Jones, Michael J.},
|
||||
title = {Robust real-time face detection},
|
||||
journal = {International Journal of Computer Vision},
|
||||
year = {2004},
|
||||
volume = {57},
|
||||
number = {2},
|
||||
pages = {137--154},
|
||||
publisher = {Kluwer Academic Publishers}
|
||||
}
|
||||
@INPROCEEDINGS{WJ10,
|
||||
author = {Xu, Wei and Mulligan, Jane},
|
||||
title = {Performance evaluation of color correction approaches for automatic multi-view image and video stitching},
|
||||
|
@ -130,11 +130,11 @@ for fname in images:
|
||||
if ret == True:
|
||||
objpoints.append(objp)
|
||||
|
||||
cv2.cornerSubPix(gray,corners, (11,11), (-1,-1), criteria)
|
||||
corners2=cv2.cornerSubPix(gray,corners, (11,11), (-1,-1), criteria)
|
||||
imgpoints.append(corners)
|
||||
|
||||
# Draw and display the corners
|
||||
cv2.drawChessboardCorners(img, (7,6), corners, ret)
|
||||
cv2.drawChessboardCorners(img, (7,6), corners2, ret)
|
||||
cv2.imshow('img', img)
|
||||
cv2.waitKey(500)
|
||||
|
||||
|
@ -70,15 +70,15 @@ for fname in glob.glob('left*.jpg'):
|
||||
corners2 = cv2.cornerSubPix(gray,corners,(11,11),(-1,-1),criteria)
|
||||
|
||||
# Find the rotation and translation vectors.
|
||||
rvecs, tvecs, inliers = cv2.solvePnPRansac(objp, corners2, mtx, dist)
|
||||
ret,rvecs, tvecs, inliers = cv2.solvePnP(objp, corners2, mtx, dist)
|
||||
|
||||
# project 3D points to image plane
|
||||
imgpts, jac = cv2.projectPoints(axis, rvecs, tvecs, mtx, dist)
|
||||
|
||||
img = draw(img,corners2,imgpts)
|
||||
cv2.imshow('img',img)
|
||||
k = cv2.waitKey(0) & 0xff
|
||||
if k == 's':
|
||||
k = cv2.waitKey(0) & 0xFF
|
||||
if k == ord('s'):
|
||||
cv2.imwrite(fname[:6]+'.png', img)
|
||||
|
||||
cv2.destroyAllWindows()
|
||||
|
@ -49,7 +49,7 @@ BRIEF in OpenCV
|
||||
Below code shows the computation of BRIEF descriptors with the help of CenSurE detector. (CenSurE
|
||||
detector is called STAR detector in OpenCV)
|
||||
|
||||
note, that you need [opencv contrib](https://github.com/Itseez/opencv_contrib)) to use this.
|
||||
note, that you need [opencv contrib](https://github.com/opencv/opencv_contrib)) to use this.
|
||||
@code{.py}
|
||||
import numpy as np
|
||||
import cv2
|
||||
|
@ -105,7 +105,7 @@ fast = cv2.FastFeatureDetector_create()
|
||||
|
||||
# find and draw the keypoints
|
||||
kp = fast.detect(img,None)
|
||||
img2 = cv2.drawKeypoints(img, kp, color=(255,0,0))
|
||||
img2 = cv2.drawKeypoints(img, kp, None, color=(255,0,0))
|
||||
|
||||
# Print all default params
|
||||
print "Threshold: ", fast.getInt('threshold')
|
||||
@ -121,7 +121,7 @@ kp = fast.detect(img,None)
|
||||
|
||||
print "Total Keypoints without nonmaxSuppression: ", len(kp)
|
||||
|
||||
img3 = cv2.drawKeypoints(img, kp, color=(255,0,0))
|
||||
img3 = cv2.drawKeypoints(img, kp, None, color=(255,0,0))
|
||||
|
||||
cv2.imwrite('fast_false.png',img3)
|
||||
@endcode
|
||||
|
@ -22,61 +22,61 @@ Well, the questions and imaginations continue. But it all depends on the most ba
|
||||
you play jigsaw puzzles? How do you arrange lots of scrambled image pieces into a big single image?
|
||||
How can you stitch a lot of natural images to a single image?
|
||||
|
||||
The answer is, we are looking for specific patterns or specific features which are unique, which can
|
||||
be easily tracked, which can be easily compared. If we go for a definition of such a feature, we may
|
||||
find it difficult to express it in words, but we know what are they. If some one asks you to point
|
||||
The answer is, we are looking for specific patterns or specific features which are unique, can
|
||||
be easily tracked and can be easily compared. If we go for a definition of such a feature, we may
|
||||
find it difficult to express it in words, but we know what they are. If someone asks you to point
|
||||
out one good feature which can be compared across several images, you can point out one. That is
|
||||
why, even small children can simply play these games. We search for these features in an image, we
|
||||
find them, we find the same features in other images, we align them. That's it. (In jigsaw puzzle,
|
||||
why even small children can simply play these games. We search for these features in an image,
|
||||
find them, look for the same features in other images and align them. That's it. (In jigsaw puzzle,
|
||||
we look more into continuity of different images). All these abilities are present in us inherently.
|
||||
|
||||
So our one basic question expands to more in number, but becomes more specific. **What are these
|
||||
features?**. *(The answer should be understandable to a computer also.)*
|
||||
features?**. (The answer should be understandable also to a computer.)
|
||||
|
||||
Well, it is difficult to say how humans find these features. It is already programmed in our brain.
|
||||
It is difficult to say how humans find these features. This is already programmed in our brain.
|
||||
But if we look deep into some pictures and search for different patterns, we will find something
|
||||
interesting. For example, take below image:
|
||||
|
||||

|
||||
|
||||
Image is very simple. At the top of image, six small image patches are given. Question for you is to
|
||||
find the exact location of these patches in the original image. How many correct results you can
|
||||
find ?
|
||||
The image is very simple. At the top of image, six small image patches are given. Question for you is to
|
||||
find the exact location of these patches in the original image. How many correct results can you
|
||||
find?
|
||||
|
||||
A and B are flat surfaces, and they are spread in a lot of area. It is difficult to find the exact
|
||||
A and B are flat surfaces and they are spread over a lot of area. It is difficult to find the exact
|
||||
location of these patches.
|
||||
|
||||
C and D are much more simpler. They are edges of the building. You can find an approximate location,
|
||||
but exact location is still difficult. It is because, along the edge, it is same everywhere. Normal
|
||||
to the edge, it is different. So edge is a much better feature compared to flat area, but not good
|
||||
enough (It is good in jigsaw puzzle for comparing continuity of edges).
|
||||
C and D are much more simple. They are edges of the building. You can find an approximate location,
|
||||
but exact location is still difficult. This is because the pattern is same everywhere along the edge.
|
||||
At the edge, however, it is different. An edge is therefore better feature compared to flat area, but
|
||||
not good enough (It is good in jigsaw puzzle for comparing continuity of edges).
|
||||
|
||||
Finally, E and F are some corners of the building. And they can be easily found out. Because at
|
||||
corners, wherever you move this patch, it will look different. So they can be considered as a good
|
||||
feature. So now we move into more simpler (and widely used image) for better understanding.
|
||||
Finally, E and F are some corners of the building. And they can be easily found. Because at the
|
||||
corners, wherever you move this patch, it will look different. So they can be considered as good
|
||||
features. So now we move into simpler (and widely used image) for better understanding.
|
||||
|
||||

|
||||
|
||||
Just like above, blue patch is flat area and difficult to find and track. Wherever you move the blue
|
||||
patch, it looks the same. For black patch, it is an edge. If you move it in vertical direction (i.e.
|
||||
along the gradient) it changes. Put along the edge (parallel to edge), it looks the same. And for
|
||||
Just like above, the blue patch is flat area and difficult to find and track. Wherever you move the blue
|
||||
patch it looks the same. The black patch has an edge. If you move it in vertical direction (i.e.
|
||||
along the gradient) it changes. Moved along the edge (parallel to edge), it looks the same. And for
|
||||
red patch, it is a corner. Wherever you move the patch, it looks different, means it is unique. So
|
||||
basically, corners are considered to be good features in an image. (Not just corners, in some cases
|
||||
blobs are considered good features).
|
||||
|
||||
So now we answered our question, "what are these features?". But next question arises. How do we
|
||||
find them? Or how do we find the corners?. That also we answered in an intuitive way, i.e., look for
|
||||
find them? Or how do we find the corners?. We answered that in an intuitive way, i.e., look for
|
||||
the regions in images which have maximum variation when moved (by a small amount) in all regions
|
||||
around it. This would be projected into computer language in coming chapters. So finding these image
|
||||
features is called **Feature Detection**.
|
||||
|
||||
So we found the features in image (Assume you did it). Once you found it, you should find the same
|
||||
in the other images. What we do? We take a region around the feature, we explain it in our own
|
||||
words, like "upper part is blue sky, lower part is building region, on that building there are some
|
||||
glasses etc" and you search for the same area in other images. Basically, you are describing the
|
||||
feature. Similar way, computer also should describe the region around the feature so that it can
|
||||
We found the features in the images. Once you have found it, you should be able to find the same
|
||||
in the other images. How is this done? We take a region around the feature, we explain it in our own
|
||||
words, like "upper part is blue sky, lower part is region from a building, on that building there is
|
||||
glass etc" and you search for the same area in the other images. Basically, you are describing the
|
||||
feature. Similarly, a computer also should describe the region around the feature so that it can
|
||||
find it in other images. So called description is called **Feature Description**. Once you have the
|
||||
features and its description, you can find same features in all images and align them, stitch them
|
||||
features and its description, you can find same features in all images and align them, stitch them together
|
||||
or do whatever you want.
|
||||
|
||||
So in this module, we are looking to different algorithms in OpenCV to find features, describe them,
|
||||
|
@ -79,8 +79,8 @@ kp = orb.detect(img,None)
|
||||
kp, des = orb.compute(img, kp)
|
||||
|
||||
# draw only keypoints location,not size and orientation
|
||||
img2 = cv2.drawKeypoints(img,kp,color=(0,255,0), flags=0)
|
||||
plt.imshow(img2),plt.show()
|
||||
img2 = cv2.drawKeypoints(img, kp, None, color=(0,255,0), flags=0)
|
||||
plt.imshow(img2), plt.show()
|
||||
@endcode
|
||||
See the result below:
|
||||
|
||||
|
@ -104,7 +104,7 @@ greater than 0.8, they are rejected. It eliminaters around 90% of false matches
|
||||
|
||||
So this is a summary of SIFT algorithm. For more details and understanding, reading the original
|
||||
paper is highly recommended. Remember one thing, this algorithm is patented. So this algorithm is
|
||||
included in [the opencv contrib repo](https://github.com/Itseez/opencv_contrib)
|
||||
included in [the opencv contrib repo](https://github.com/opencv/opencv_contrib)
|
||||
|
||||
SIFT in OpenCV
|
||||
--------------
|
||||
@ -122,7 +122,7 @@ gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
|
||||
sift = cv2.xfeatures2d.SIFT_create()
|
||||
kp = sift.detect(gray,None)
|
||||
|
||||
img=cv2.drawKeypoints(gray,kp)
|
||||
img=cv2.drawKeypoints(gray,kp,img)
|
||||
|
||||
cv2.imwrite('sift_keypoints.jpg',img)
|
||||
@endcode
|
||||
@ -135,7 +135,7 @@ OpenCV also provides **cv2.drawKeyPoints()** function which draws the small circ
|
||||
of keypoints. If you pass a flag, **cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS** to it, it will
|
||||
draw a circle with size of keypoint and it will even show its orientation. See below example.
|
||||
@code{.py}
|
||||
img=cv2.drawKeypoints(gray,kp,flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
|
||||
img=cv2.drawKeypoints(gray,kp,img,flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
|
||||
cv2.imwrite('sift_keypoints.jpg',img)
|
||||
@endcode
|
||||
See the two results below:
|
||||
|
@ -58,7 +58,7 @@ OpenCV Needs You !!!
|
||||
Since OpenCV is an open source initiative, all are welcome to make contributions to the library,
|
||||
documentation, and tutorials. If you find any mistake in this tutorial (from a small spelling
|
||||
mistake to an egregious error in code or concept), feel free to correct it by cloning OpenCV in
|
||||
[GitHub](https://github.com/Itseez/opencv) and submitting a pull request. OpenCV developers will
|
||||
[GitHub](https://github.com/opencv/opencv) and submitting a pull request. OpenCV developers will
|
||||
check your pull request, give you important feedback and (once it passes the approval of the
|
||||
reviewer) it will be merged into OpenCV. You will then become an open source contributor :-)
|
||||
|
||||
|
@ -119,7 +119,7 @@ Or you can download latest source from OpenCV's github repo. (If you want to con
|
||||
choose this. It always keeps your OpenCV up-to-date). For that, you need to install **Git** first.
|
||||
@code{.sh}
|
||||
yum install git
|
||||
git clone https://github.com/Itseez/opencv.git
|
||||
git clone https://github.com/opencv/opencv.git
|
||||
@endcode
|
||||
It will create a folder OpenCV in home directory (or the directory you specify). The cloning may
|
||||
take some time depending upon your internet connection.
|
||||
|
@ -76,7 +76,7 @@ Building OpenCV from source
|
||||
|
||||
-# Download OpenCV source. It can be from
|
||||
[Sourceforge](http://sourceforge.net/projects/opencvlibrary/) (for official release version) or
|
||||
from [Github](https://github.com/Itseez/opencv) (for latest source).
|
||||
from [Github](https://github.com/opencv/opencv) (for latest source).
|
||||
-# Extract it to a folder, opencv and create a new folder build in it.
|
||||
-# Open CMake-gui (*Start \> All Programs \> CMake-gui*)
|
||||
-# Fill the fields as follows (see the image below):
|
||||
|
@ -77,13 +77,13 @@ Source code
|
||||
|
||||
You may also find the source code in the `samples/cpp/tutorial_code/calib3d/camera_calibration/`
|
||||
folder of the OpenCV source library or [download it from here
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp). The program has a
|
||||
](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp). The program has a
|
||||
single argument: the name of its configuration file. If none is given then it will try to open the
|
||||
one named "default.xml". [Here's a sample configuration file
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/calib3d/camera_calibration/in_VID5.xml) in XML format. In the
|
||||
](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/calib3d/camera_calibration/in_VID5.xml) in XML format. In the
|
||||
configuration file you may choose to use camera as an input, a video file or an image list. If you
|
||||
opt for the last one, you will need to create a configuration file where you enumerate the images to
|
||||
use. Here's [an example of this ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/calib3d/camera_calibration/VID5.xml).
|
||||
use. Here's [an example of this ](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/calib3d/camera_calibration/VID5.xml).
|
||||
The important part to remember is that the images need to be specified using the absolute path or
|
||||
the relative one from your application's working directory. You may find all this in the samples
|
||||
directory mentioned above.
|
||||
|
@ -92,7 +92,7 @@ QR faster than SVD, but potentially less precise
|
||||
- *camera_resolution*: resolution of camera which is used for calibration
|
||||
|
||||
**Note:** *charuco_dict*, *charuco_square_lenght* and *charuco_marker_size* are used for chAruco pattern generation
|
||||
(see Aruco module description for details: [Aruco tutorials](https://github.com/Itseez/opencv_contrib/tree/master/modules/aruco/tutorials))
|
||||
(see Aruco module description for details: [Aruco tutorials](https://github.com/opencv/opencv_contrib/tree/master/modules/aruco/tutorials))
|
||||
|
||||
Default chAruco pattern:
|
||||
|
||||
|
@ -47,7 +47,7 @@ Code
|
||||
----
|
||||
|
||||
- This code is in your OpenCV sample folder. Otherwise you can grab it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/Matrix/Drawing_1.cpp)
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
@ -15,7 +15,7 @@ Source code
|
||||
-----------
|
||||
|
||||
You can [download this from here
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/discrete_fourier_transform/discrete_fourier_transform.cpp) or
|
||||
](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/discrete_fourier_transform/discrete_fourier_transform.cpp) or
|
||||
find it in the
|
||||
`samples/cpp/tutorial_code/core/discrete_fourier_transform/discrete_fourier_transform.cpp` of the
|
||||
OpenCV source code library.
|
||||
@ -140,7 +140,7 @@ An application idea would be to determine the geometrical orientation present in
|
||||
example, let us find out if a text is horizontal or not? Looking at some text you'll notice that the
|
||||
text lines sort of form also horizontal lines and the letters form sort of vertical lines. These two
|
||||
main components of a text snippet may be also seen in case of the Fourier transform. Let us use
|
||||
[this horizontal ](https://github.com/Itseez/opencv/tree/master/samples/data/imageTextN.png) and [this rotated](https://github.com/Itseez/opencv/tree/master/samples/data/imageTextR.png)
|
||||
[this horizontal ](https://github.com/opencv/opencv/tree/master/samples/data/imageTextN.png) and [this rotated](https://github.com/opencv/opencv/tree/master/samples/data/imageTextR.png)
|
||||
image about a text.
|
||||
|
||||
In case of the horizontal text:
|
||||
|
@ -16,7 +16,7 @@ Source code
|
||||
-----------
|
||||
|
||||
You can [download this from here
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/file_input_output/file_input_output.cpp) or find it in the
|
||||
](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/file_input_output/file_input_output.cpp) or find it in the
|
||||
`samples/cpp/tutorial_code/core/file_input_output/file_input_output.cpp` of the OpenCV source code
|
||||
library.
|
||||
|
||||
|
@ -51,7 +51,7 @@ three major ways of going through an image pixel by pixel. To make things a litt
|
||||
will make the scanning for each image using all of these methods, and print out how long it took.
|
||||
|
||||
You can download the full source code [here
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp) or look it up in
|
||||
](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/how_to_scan_images/how_to_scan_images.cpp) or look it up in
|
||||
the samples directory of OpenCV at the cpp tutorial code for the core section. Its basic usage is:
|
||||
@code{.bash}
|
||||
how_to_scan_images imageName.jpg intValueToReduce [G]
|
||||
|
@ -16,7 +16,7 @@ Code
|
||||
|
||||
You may also find the source code in the
|
||||
`samples/cpp/tutorial_code/core/ippasync/ippasync_sample.cpp` file of the OpenCV source library or
|
||||
download it from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/ippasync/ippasync_sample.cpp).
|
||||
download it from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/ippasync/ippasync_sample.cpp).
|
||||
|
||||
@include cpp/tutorial_code/core/ippasync/ippasync_sample.cpp
|
||||
|
||||
|
@ -85,7 +85,7 @@ L = Mat(pI);
|
||||
A case study
|
||||
------------
|
||||
|
||||
Now that you have the basics done [here's](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp)
|
||||
Now that you have the basics done [here's](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp)
|
||||
an example that mixes the usage of the C interface with the C++ one. You will also find it in the
|
||||
sample directory of the OpenCV source code library at the
|
||||
`samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp` .
|
||||
@ -132,7 +132,7 @@ output:
|
||||
|
||||
You may observe a runtime instance of this on the [YouTube
|
||||
here](https://www.youtube.com/watch?v=qckm-zvo31w) and you can [download the source code from here
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp)
|
||||
](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp)
|
||||
or find it in the
|
||||
`samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp`
|
||||
of the OpenCV source code library.
|
||||
|
@ -133,7 +133,7 @@ For example:
|
||||

|
||||
|
||||
You can download this source code from [here
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp) or look in the
|
||||
](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp) or look in the
|
||||
OpenCV source code libraries sample directory at
|
||||
`samples/cpp/tutorial_code/core/mat_mask_operations/mat_mask_operations.cpp`.
|
||||
|
||||
|
@ -258,7 +258,7 @@ OpenCV offers support for output of other common OpenCV data structures too via
|
||||

|
||||
|
||||
Most of the samples here have been included in a small console application. You can download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/core/mat_the_basic_image_container/mat_the_basic_image_container.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/mat_the_basic_image_container/mat_the_basic_image_container.cpp)
|
||||
or in the core section of the cpp samples.
|
||||
|
||||
You can also find a quick video demonstration of this on
|
||||
|
@ -16,7 +16,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp)
|
||||
@code{.cpp}
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
@ -20,7 +20,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp)
|
||||
|
||||
@include cpp/tutorial_code/TrackingMotion/cornerDetector_Demo.cpp
|
||||
|
||||
|
@ -15,7 +15,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/goodFeaturesToTrack_Demo.cpp)
|
||||
@code{.cpp}
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
@ -119,7 +119,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp)
|
||||
@code{.cpp}
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
@ -24,7 +24,7 @@ The source code
|
||||
|
||||
You may also find the source code and these video file in the
|
||||
`samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity` folder of the OpenCV
|
||||
source library or download it from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity.cpp).
|
||||
source library or download it from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/gpu/gpu-basics-similarity/gpu-basics-similarity.cpp).
|
||||
The full source code is quite long (due to the controlling of the application via the command line
|
||||
arguments and performance measurement). Therefore, to avoid cluttering up these sections with those
|
||||
you'll find here only the functions itself.
|
||||
|
@ -60,7 +60,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -94,7 +94,7 @@ Code
|
||||
- Applies 4 different kinds of filters (explained in Theory) and show the filtered images
|
||||
sequentially
|
||||
- **Downloadable code**: Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Smoothing.cpp)
|
||||
- **Code at glance:**
|
||||
@code{.cpp}
|
||||
#include "opencv2/imgproc.hpp"
|
||||
|
@ -70,13 +70,13 @@ Code
|
||||
- **Downloadable code**:
|
||||
|
||||
-# Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo1.cpp)
|
||||
for the basic version (explained in this tutorial).
|
||||
-# For stuff slightly fancier (using H-S histograms and floodFill to define a mask for the
|
||||
skin area) you can check the [improved
|
||||
demo](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp)
|
||||
demo](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcBackProject_Demo2.cpp)
|
||||
-# ...or you can always check out the classical
|
||||
[camshiftdemo](https://github.com/Itseez/opencv/tree/master/samples/cpp/camshiftdemo.cpp)
|
||||
[camshiftdemo](https://github.com/opencv/opencv/tree/master/samples/cpp/camshiftdemo.cpp)
|
||||
in samples.
|
||||
|
||||
- **Code at glance:**
|
||||
|
@ -66,7 +66,7 @@ Code
|
||||
- Calculate the Histogram of each 1-channel plane by calling the function @ref cv::calcHist
|
||||
- Plot the three histograms in a window
|
||||
- **Downloadable code**: Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp)
|
||||
- **Code at glance:**
|
||||
@include samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp
|
||||
|
||||
|
@ -44,7 +44,7 @@ Code
|
||||
histogram of the lower half base image and with the same base image histogram.
|
||||
- Display the numerical matching parameters obtained.
|
||||
- **Downloadable code**: Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp)
|
||||
- **Code at glance:**
|
||||
|
||||
@include cpp/tutorial_code/Histograms_Matching/compareHist_Demo.cpp
|
||||
|
@ -62,7 +62,7 @@ Code
|
||||
- Equalize the Histogram by using the OpenCV function @ref cv::equalizeHist
|
||||
- Display the source and equalized images in a window.
|
||||
- **Downloadable code**: Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp)
|
||||
- **Code at glance:**
|
||||
@include samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp
|
||||
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
@ -19,6 +19,10 @@ Theory
|
||||
Template matching is a technique for finding areas of an image that match (are similar) to a
|
||||
template image (patch).
|
||||
|
||||
While the patch must be a rectangle it may be that not all of the
|
||||
rectangle is relevant. In such a case, a mask can be used to isolate the portion of the patch
|
||||
that should be used to find the match.
|
||||
|
||||
### How does it work?
|
||||
|
||||
- We need two primary components:
|
||||
@ -51,6 +55,30 @@ template image (patch).
|
||||
- In practice, we use the function @ref cv::minMaxLoc to locate the highest value (or lower,
|
||||
depending of the type of matching method) in the *R* matrix.
|
||||
|
||||
### How does the mask work?
|
||||
- If masking is needed for the match, three components are required:
|
||||
|
||||
-# **Source image (I):** The image in which we expect to find a match to the template image
|
||||
-# **Template image (T):** The patch image which will be compared to the template image
|
||||
-# **Mask image (M):** The mask, a grayscale image that masks the template
|
||||
|
||||
|
||||
- Only two matching methods currently accept a mask: CV_TM_SQDIFF and CV_TM_CCORR_NORMED (see
|
||||
below for explanation of all the matching methods available in opencv).
|
||||
|
||||
|
||||
- The mask must have the same dimensions as the template
|
||||
|
||||
|
||||
- The mask should have a CV_8U or CV_32F depth and the same number of channels
|
||||
as the template image. In CV_8U case, the mask values are treated as binary,
|
||||
i.e. zero and non-zero. In CV_32F case, the values should fall into [0..1]
|
||||
range and the template pixels will be multiplied by the corresponding mask pixel
|
||||
values. Since the input images in the sample have the CV_8UC3 type, the mask
|
||||
is also read as color image.
|
||||
|
||||

|
||||
|
||||
### Which are the matching methods available in OpenCV?
|
||||
|
||||
Good question. OpenCV implements Template matching in the function @ref cv::matchTemplate . The
|
||||
@ -88,15 +116,16 @@ Code
|
||||
----
|
||||
|
||||
- **What does this program do?**
|
||||
- Loads an input image and a image patch (*template*)
|
||||
- Loads an input image, an image patch (*template*), and optionally a mask
|
||||
- Perform a template matching procedure by using the OpenCV function @ref cv::matchTemplate
|
||||
with any of the 6 matching methods described before. The user can choose the method by
|
||||
entering its selection in the Trackbar.
|
||||
entering its selection in the Trackbar. If a mask is supplied, it will only be used for
|
||||
the methods that support masking
|
||||
- Normalize the output of the matching procedure
|
||||
- Localize the location with higher matching probability
|
||||
- Draw a rectangle around the area corresponding to the highest match
|
||||
- **Downloadable code**: Click
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp)
|
||||
- **Code at glance:**
|
||||
@include samples/cpp/tutorial_code/Histograms_Matching/MatchTemplate_Demo.cpp
|
||||
|
||||
@ -113,10 +142,14 @@ Explanation
|
||||
int match_method;
|
||||
int max_Trackbar = 5;
|
||||
@endcode
|
||||
-# Load the source image and template:
|
||||
-# Load the source image, template, and optionally, if supported for the matching method, a mask:
|
||||
@code{.cpp}
|
||||
img = imread( argv[1], 1 );
|
||||
templ = imread( argv[2], 1 );
|
||||
bool method_accepts_mask = (CV_TM_SQDIFF == match_method || match_method == CV_TM_CCORR_NORMED);
|
||||
if (use_mask && method_accepts_mask)
|
||||
{ matchTemplate( img, templ, result, match_method, mask); }
|
||||
else
|
||||
{ matchTemplate( img, templ, result, match_method); }
|
||||
|
||||
@endcode
|
||||
-# Create the windows to show the results:
|
||||
@code{.cpp}
|
||||
@ -150,10 +183,14 @@ Explanation
|
||||
@endcode
|
||||
-# Perform the template matching operation:
|
||||
@code{.cpp}
|
||||
matchTemplate( img, templ, result, match_method );
|
||||
bool method_accepts_mask = (CV_TM_SQDIFF == match_method || match_method == CV_TM_CCORR_NORMED);
|
||||
if (use_mask && method_accepts_mask)
|
||||
{ matchTemplate( img, templ, result, match_method, mask); }
|
||||
else
|
||||
{ matchTemplate( img, templ, result, match_method); }
|
||||
@endcode
|
||||
the arguments are naturally the input image **I**, the template **T**, the result **R** and the
|
||||
match_method (given by the Trackbar)
|
||||
the arguments are naturally the input image **I**, the template **T**, the result **R**, the
|
||||
match_method (given by the Trackbar), and optionally the mask image **M**
|
||||
|
||||
-# We normalize the results:
|
||||
@code{.cpp}
|
||||
|
@ -74,7 +74,7 @@ Code
|
||||
- Applies the mask obtained on the original image and display it in a window.
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgTrans/CannyDetector_Demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -46,7 +46,7 @@ Code
|
||||
- The program finishes when the user presses 'ESC'
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgTrans/copyMakeBorder_demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -17,7 +17,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp).
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp).
|
||||
@include samples/cpp/tutorial_code/ImgTrans/imageSegmentation.cpp
|
||||
|
||||
Explanation / Result
|
||||
|
@ -62,7 +62,7 @@ Code
|
||||
- The filter output (with each kernel) will be shown during 500 milliseconds
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/filter2D_demo.cpp)
|
||||
@code{.cpp}
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
@ -39,9 +39,9 @@ Code
|
||||
- Applies the *Hough Circle Transform* to the blurred image .
|
||||
- Display the detected circle in a window.
|
||||
|
||||
-# The sample code that we will explain can be downloaded from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/houghcircles.cpp).
|
||||
-# The sample code that we will explain can be downloaded from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/houghcircles.cpp).
|
||||
A slightly fancier version (which shows trackbars for
|
||||
changing the threshold values) can be found [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp).
|
||||
changing the threshold values) can be found [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp).
|
||||
@include samples/cpp/houghcircles.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -95,9 +95,9 @@ Code
|
||||
- Applies either a *Standard Hough Line Transform* or a *Probabilistic Line Transform*.
|
||||
- Display the original image and the detected line in two windows.
|
||||
|
||||
-# The sample code that we will explain can be downloaded from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/houghlines.cpp). A slightly fancier version
|
||||
-# The sample code that we will explain can be downloaded from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/houghlines.cpp). A slightly fancier version
|
||||
(which shows both Hough standard and probabilistic with trackbars for changing the threshold
|
||||
values) can be found [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp).
|
||||
values) can be found [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp).
|
||||
@include samples/cpp/houghlines.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -51,7 +51,7 @@ Code
|
||||
- Display the result in a window
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgTrans/Laplace_Demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -52,7 +52,7 @@ Code
|
||||
- Wait for the user to exit the program
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgTrans/Remap_Demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -108,7 +108,7 @@ Code
|
||||
bright on a darker background.
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgTrans/Sobel_Demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -89,7 +89,7 @@ Code
|
||||
- Waits until the user exits the program
|
||||
|
||||
-# The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgTrans/Geometric_Transforms_Demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -48,7 +48,7 @@ A structuring element can have many common shapes, such as lines, diamonds, disk
|
||||
Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from [here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_3.cpp).
|
||||
This tutorial code's is shown lines below. You can also download it from [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_3.cpp).
|
||||
@include samples/cpp/tutorial_code/ImgProc/Morphology_3.cpp
|
||||
|
||||
Explanation / Result
|
||||
|
@ -80,7 +80,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Morphology_2.cpp)
|
||||
@code{.cpp}
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
@ -66,7 +66,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Pyramids.cpp)
|
||||
|
||||
@include samples/cpp/tutorial_code/ImgProc/Pyramids.cpp
|
||||
|
||||
|
@ -16,7 +16,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp)
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -16,7 +16,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp)
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -16,7 +16,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -15,7 +15,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp)
|
||||
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp
|
||||
|
||||
|
@ -17,7 +17,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -15,7 +15,7 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp)
|
||||
@include samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -97,7 +97,7 @@ Code
|
||||
----
|
||||
|
||||
The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Threshold.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Threshold.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgProc/Threshold.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -19,7 +19,7 @@ Code
|
||||
----
|
||||
|
||||
The tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Threshold_inRange.cpp)
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/Threshold_inRange.cpp)
|
||||
@include samples/cpp/tutorial_code/ImgProc/Threshold_inRange.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -17,7 +17,7 @@ If you need help with anything of the above, you may refer to our @ref tutorial_
|
||||
This tutorial also assumes you have an Android operated device with OpenCL enabled.
|
||||
|
||||
The related source code is located within OpenCV samples at
|
||||
[opencv/samples/android/tutorial-4-opencl](https://github.com/Itseez/opencv/tree/master/samples/android/tutorial-4-opencl/) directory.
|
||||
[opencv/samples/android/tutorial-4-opencl](https://github.com/opencv/opencv/tree/master/samples/android/tutorial-4-opencl/) directory.
|
||||
|
||||
Preface
|
||||
-------
|
||||
@ -244,7 +244,7 @@ As you can see, inheritors for `Camera` and `Camera2` APIs should implement the
|
||||
@endcode
|
||||
|
||||
Let's leave the details of their implementation beyond of this tutorial, please refer the
|
||||
[source code](https://github.com/Itseez/opencv/tree/master/samples/android/tutorial-4-opencl/) to see them.
|
||||
[source code](https://github.com/opencv/opencv/tree/master/samples/android/tutorial-4-opencl/) to see them.
|
||||
|
||||
Preview Frames modification
|
||||
---------------------------
|
||||
|
@ -40,7 +40,7 @@ I'm assuming you already installed [xcode](https://developer.apple.com/xcode/),
|
||||
@code{.bash}
|
||||
cd ~/
|
||||
mkdir opt
|
||||
git clone https://github.com/Itseez/opencv.git
|
||||
git clone https://github.com/opencv/opencv.git
|
||||
cd opencv
|
||||
git checkout 2.4
|
||||
mkdir build
|
||||
|
@ -33,7 +33,7 @@ Getting OpenCV Source Code
|
||||
--------------------------
|
||||
|
||||
You can use the latest stable OpenCV version available in *sourceforge* or you can grab the latest
|
||||
snapshot from our [Git repository](https://github.com/Itseez/opencv.git).
|
||||
snapshot from our [Git repository](https://github.com/opencv/opencv.git).
|
||||
|
||||
### Getting the Latest Stable OpenCV Version
|
||||
|
||||
@ -42,12 +42,12 @@ snapshot from our [Git repository](https://github.com/Itseez/opencv.git).
|
||||
|
||||
### Getting the Cutting-edge OpenCV from the Git Repository
|
||||
|
||||
Launch Git client and clone [OpenCV repository](http://github.com/itseez/opencv)
|
||||
Launch Git client and clone [OpenCV repository](http://github.com/opencv/opencv)
|
||||
|
||||
In Linux it can be achieved with the following command in Terminal:
|
||||
@code{.bash}
|
||||
cd ~/<my_working _directory>
|
||||
git clone https://github.com/Itseez/opencv.git
|
||||
git clone https://github.com/opencv/opencv.git
|
||||
@endcode
|
||||
|
||||
Building OpenCV
|
||||
|
@ -36,7 +36,7 @@ from the [OpenCV SourceForge repository](http://sourceforge.net/projects/opencvl
|
||||
sources.
|
||||
|
||||
Another option to get OpenCV sources is to clone [OpenCV git
|
||||
repository](https://github.com/Itseez/opencv/). In order to build OpenCV with Java bindings you need
|
||||
repository](https://github.com/opencv/opencv/). In order to build OpenCV with Java bindings you need
|
||||
JDK (Java Development Kit) (we recommend [Oracle/Sun JDK 6 or
|
||||
7](http://www.oracle.com/technetwork/java/javase/downloads/)), [Apache Ant](http://ant.apache.org/)
|
||||
and Python v2.6 or higher to be installed.
|
||||
@ -45,7 +45,7 @@ and Python v2.6 or higher to be installed.
|
||||
|
||||
Let's build OpenCV:
|
||||
@code{.bash}
|
||||
git clone git://github.com/Itseez/opencv.git
|
||||
git clone git://github.com/opencv/opencv.git
|
||||
cd opencv
|
||||
git checkout 2.4
|
||||
mkdir build
|
||||
|
@ -14,7 +14,7 @@ Source Code
|
||||
-----------
|
||||
|
||||
Download the source code from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/introduction/display_image/display_image.cpp).
|
||||
[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/introduction/display_image/display_image.cpp).
|
||||
|
||||
@include cpp/tutorial_code/introduction/display_image/display_image.cpp
|
||||
|
||||
|
@ -9,13 +9,13 @@ Required Packages
|
||||
|
||||
### Getting the Cutting-edge OpenCV from Git Repository
|
||||
|
||||
Launch GIT client and clone OpenCV repository from [here](http://github.com/itseez/opencv)
|
||||
Launch GIT client and clone OpenCV repository from [here](http://github.com/opencv/opencv)
|
||||
|
||||
In MacOS it can be done using the following command in Terminal:
|
||||
|
||||
@code{.bash}
|
||||
cd ~/<my_working _directory>
|
||||
git clone https://github.com/Itseez/opencv.git
|
||||
git clone https://github.com/opencv/opencv.git
|
||||
@endcode
|
||||
|
||||
Building OpenCV from Source, using CMake and Command Line
|
||||
|
@ -16,6 +16,7 @@ Required Packages
|
||||
- [optional] libtbb2 libtbb-dev
|
||||
- [optional] libdc1394 2.x
|
||||
- [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev, libdc1394-22-dev
|
||||
- [optional] CUDA Toolkit 6.5 or higher
|
||||
|
||||
The packages can be installed using a terminal and the following commands or by using Synaptic
|
||||
Manager:
|
||||
@ -28,7 +29,7 @@ Getting OpenCV Source Code
|
||||
--------------------------
|
||||
|
||||
You can use the latest stable OpenCV version or you can grab the latest snapshot from our [Git
|
||||
repository](https://github.com/Itseez/opencv.git).
|
||||
repository](https://github.com/opencv/opencv.git).
|
||||
|
||||
### Getting the Latest Stable OpenCV Version
|
||||
|
||||
@ -37,14 +38,14 @@ repository](https://github.com/Itseez/opencv.git).
|
||||
|
||||
### Getting the Cutting-edge OpenCV from the Git Repository
|
||||
|
||||
Launch Git client and clone [OpenCV repository](http://github.com/itseez/opencv). If you need
|
||||
modules from [OpenCV contrib repository](http://github.com/itseez/opencv_contrib) then clone it too.
|
||||
Launch Git client and clone [OpenCV repository](http://github.com/opencv/opencv). If you need
|
||||
modules from [OpenCV contrib repository](http://github.com/opencv/opencv_contrib) then clone it too.
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
cd ~/<my_working_directory>
|
||||
git clone https://github.com/Itseez/opencv.git
|
||||
git clone https://github.com/Itseez/opencv_contrib.git
|
||||
git clone https://github.com/opencv/opencv.git
|
||||
git clone https://github.com/opencv/opencv_contrib.git
|
||||
@endcode
|
||||
Building OpenCV from Source Using CMake
|
||||
---------------------------------------
|
||||
@ -114,11 +115,11 @@ Building OpenCV from Source Using CMake
|
||||
-# [optional] Running tests
|
||||
|
||||
- Get the required test data from [OpenCV extra
|
||||
repository](https://github.com/Itseez/opencv_extra).
|
||||
repository](https://github.com/opencv/opencv_extra).
|
||||
|
||||
For example
|
||||
@code{.bash}
|
||||
git clone https://github.com/Itseez/opencv_extra.git
|
||||
git clone https://github.com/opencv/opencv_extra.git
|
||||
@endcode
|
||||
- set OPENCV_TEST_DATA_PATH environment variable to \<path to opencv_extra/testdata\>.
|
||||
- execute tests from build directory.
|
||||
|
@ -12,7 +12,7 @@ OpenCV 3.0 introduced many new algorithms and features comparing to version 2.4.
|
||||
This section describes most notable changes in general, all details and examples of transition actions are in the next part of the document.
|
||||
|
||||
##### Contrib repository
|
||||
<https://github.com/Itseez/opencv_contrib>
|
||||
<https://github.com/opencv/opencv_contrib>
|
||||
|
||||
This is a place for all new, experimental and non-free algorithms. It does not receive so much attention from the support team comparing to main repository, but the community makes an effort to keep it in a good shape.
|
||||
|
||||
|
@ -43,7 +43,7 @@ These videos above are long-obsolete and contain inaccurate information. Be care
|
||||
solutions described in those videos are no longer supported and may even break your install.
|
||||
|
||||
If you are building your own libraries you can take the source files from our [Git
|
||||
repository](https://github.com/Itseez/opencv.git).
|
||||
repository](https://github.com/opencv/opencv.git).
|
||||
|
||||
Building the OpenCV library from scratch requires a couple of tools installed beforehand:
|
||||
|
||||
@ -114,7 +114,7 @@ libraries). If you do not need the support for some of these you can just freely
|
||||
you're doing -- it's OK.
|
||||
-# Clone the repository to the selected directory. After clicking *Clone* button, a window will
|
||||
appear where you can select from what repository you want to download source files
|
||||
(<https://github.com/Itseez/opencv.git>) and to what directory (`D:/OpenCV`).
|
||||
(<https://github.com/opencv/opencv.git>) and to what directory (`D:/OpenCV`).
|
||||
-# Push the OK button and be patient as the repository is quite a heavy download. It will take
|
||||
some time depending on your Internet connection.
|
||||
|
||||
|
@ -189,7 +189,7 @@ Test it!
|
||||
--------
|
||||
|
||||
Now to try this out download our little test [source code
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp)
|
||||
](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp)
|
||||
or get it from the sample code folder of the OpenCV sources. Add this to your project and build it.
|
||||
Here's its content:
|
||||
|
||||
@ -205,7 +205,7 @@ the *IDE* the console window will not close once finished. It will wait for a ke
|
||||
This is important to remember when you code inside the code open and save commands. You're resources
|
||||
will be saved ( and queried for at opening!!!) relatively to your working directory. This is unless
|
||||
you give a full, explicit path as parameter for the I/O functions. In the code above we open [this
|
||||
OpenCV logo](https://github.com/Itseez/opencv/tree/master/samples/data/opencv-logo.png). Before starting up the application make sure you place
|
||||
OpenCV logo](https://github.com/opencv/opencv/tree/master/samples/data/opencv-logo.png). Before starting up the application make sure you place
|
||||
the image file in your current working directory. Modify the image file name inside the code to try
|
||||
it out on other images too. Run it and voil á:
|
||||
|
||||
|
@ -92,10 +92,10 @@ Source Code
|
||||
-----------
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp).
|
||||
[here](https://github.com/opencv/tree/master/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp).
|
||||
@include cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp
|
||||
|
||||
@note Another example using PCA for dimensionality reduction while maintaining an amount of variance can be found at [opencv_source_code/samples/cpp/pca.cpp](https://github.com/Itseez/opencv/tree/master/samples/cpp/pca.cpp)
|
||||
@note Another example using PCA for dimensionality reduction while maintaining an amount of variance can be found at [opencv_source_code/samples/cpp/pca.cpp](https://github.com/opencv/tree/master/samples/cpp/pca.cpp)
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
@ -87,7 +87,7 @@ Source Code
|
||||
-----------
|
||||
|
||||
You may also find the source code in `samples/cpp/tutorial_code/ml/non_linear_svms` folder of the OpenCV source library or
|
||||
[download it from here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp).
|
||||
[download it from here](https://github.com/opencv/tree/master/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp).
|
||||
|
||||
@note The following code has been implemented with OpenCV 3.0 classes and functions. An equivalent version of the code
|
||||
using OpenCV 2.4 can be found in [this page.](http://docs.opencv.org/2.4/doc/tutorials/ml/non_linear_svms/non_linear_svms.html#nonlinearsvms)
|
||||
|
@ -18,9 +18,9 @@ Code
|
||||
----
|
||||
|
||||
This tutorial code's is shown lines below. You can also download it from
|
||||
[here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp)
|
||||
[here](https://github.com/opencv/tree/master/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp)
|
||||
. The second version (using LBP for face detection) can be [found
|
||||
here](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp)
|
||||
here](https://github.com/opencv/tree/master/samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp)
|
||||
@code{.cpp}
|
||||
#include "opencv2/objdetect.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
@ -6,7 +6,7 @@ Introduction
|
||||
|
||||
The work with a cascade classifier inlcudes two major stages: training and detection. Detection
|
||||
stage is described in a documentation of objdetect module of general OpenCV documentation.
|
||||
Documentation gives some basic information about cascade classifier. Current guide is describing how
|
||||
This documentation gives some basic information about cascade classifier. Current guide is describing how
|
||||
to train a cascade classifier: preparation of the training data and running the training application.
|
||||
|
||||
### Important notes
|
||||
@ -14,7 +14,7 @@ to train a cascade classifier: preparation of the training data and running the
|
||||
There are two applications in OpenCV to train cascade classifier: opencv_haartraining and
|
||||
opencv_traincascade. opencv_traincascade is a newer version, written in C++ in accordance to
|
||||
OpenCV 2.x API. But the main difference between this two applications is that opencv_traincascade
|
||||
supports both Haar @cite Viola01 and @cite Liao2007 (Local Binary Patterns) features. LBP features
|
||||
supports both Haar @cite Viola01 and LBP (Local Binary Patterns) @cite Liao2007 features. LBP features
|
||||
are integer in contrast to Haar features, so both training and detection with LBP are several times
|
||||
faster then with Haar features. Regarding the LBP and Haar detection quality, it depends on
|
||||
training: the quality of training dataset first of all and training parameters too. It's possible to
|
||||
@ -152,7 +152,7 @@ Command line arguments:
|
||||
Height (in pixels) of the output samples.
|
||||
|
||||
For following procedure is used to create a sample object instance: The source image is rotated
|
||||
randomly around all three axes. The chosen angle is limited my -max?angle. Then pixels having the
|
||||
randomly around all three axes. The chosen angle is limited by -maxxangle, -maxyangle and maxzangle. Then pixels having the
|
||||
intensity from [bg_color-bg_color_threshold; bg_color+bg_color_threshold] range are
|
||||
interpreted as transparent. White noise is added to the intensities of the foreground. If the -inv
|
||||
key is specified then foreground pixel intensities are inverted. If -randinv key is specified then
|
||||
@ -288,12 +288,12 @@ Command line arguments of opencv_traincascade application grouped by purposes:
|
||||
- -minHitRate \<min_hit_rate\>
|
||||
|
||||
Minimal desired hit rate for each stage of the classifier. Overall hit rate may be estimated
|
||||
as (min_hit_rate\^number_of_stages).
|
||||
as (min_hit_rate ^ number_of_stages), @cite Viola04 §4.1.
|
||||
|
||||
- -maxFalseAlarmRate \<max_false_alarm_rate\>
|
||||
|
||||
Maximal desired false alarm rate for each stage of the classifier. Overall false alarm rate
|
||||
may be estimated as (max_false_alarm_rate\^number_of_stages).
|
||||
may be estimated as (max_false_alarm_rate ^ number_of_stages), @cite Viola04 §4.1.
|
||||
|
||||
- -weightTrimRate \<weight_trim_rate\>
|
||||
|
||||
@ -326,4 +326,4 @@ in cascade.xml file in the folder, which was passed as -data parameter. Other fi
|
||||
are created for the case of interrupted training, so you may delete them after completion of
|
||||
training.
|
||||
|
||||
Training is finished and you can test you cascade classifier!
|
||||
Training is finished and you can test your cascade classifier!
|
||||
|
@ -45,7 +45,7 @@ Two different methods are used to generate two foreground masks:
|
||||
-# @ref cv::BackgroundSubtractorMOG2
|
||||
|
||||
The results as well as the input data are shown on the screen.
|
||||
The source file can be downloaded [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/video/bg_sub.cpp).
|
||||
The source file can be downloaded [here ](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/video/bg_sub.cpp).
|
||||
|
||||
@include samples/cpp/tutorial_code/video/bg_sub.cpp
|
||||
|
||||
|
@ -78,5 +78,5 @@ there are two flags that should be used to set/get property of the needed genera
|
||||
flag value is assumed by default if neither of the two possible values of the property is set.
|
||||
|
||||
For more information please refer to the example of usage
|
||||
[intelperc_capture.cpp](https://github.com/Itseez/opencv/tree/master/samples/cpp/intelperc_capture.cpp)
|
||||
[intelperc_capture.cpp](https://github.com/opencv/tree/master/samples/cpp/intelperc_capture.cpp)
|
||||
in opencv/samples/cpp folder.
|
||||
|
@ -134,5 +134,5 @@ property. The following properties of cameras available through OpenNI interface
|
||||
- CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION
|
||||
|
||||
For more information please refer to the example of usage
|
||||
[openni_capture.cpp](https://github.com/Itseez/opencv/tree/master/samples/cpp/openni_capture.cpp) in
|
||||
[openni_capture.cpp](https://github.com/opencv/tree/master/samples/cpp/openni_capture.cpp) in
|
||||
opencv/samples/cpp folder.
|
||||
|
@ -20,8 +20,8 @@ As a test case where to show off these using OpenCV I've created a small program
|
||||
video files and performs a similarity check between them. This is something you could use to check
|
||||
just how well a new video compressing algorithms works. Let there be a reference (original) video
|
||||
like [this small Megamind clip
|
||||
](https://github.com/Itseez/opencv/tree/master/samples/data/Megamind.avi) and [a compressed
|
||||
version of it ](https://github.com/Itseez/opencv/tree/master/samples/data/Megamind_bugy.avi).
|
||||
](https://github.com/opencv/opencv/tree/master/samples/data/Megamind.avi) and [a compressed
|
||||
version of it ](https://github.com/opencv/opencv/tree/master/samples/data/Megamind_bugy.avi).
|
||||
You may also find the source code and these video file in the
|
||||
`samples/data` folder of the OpenCV source library.
|
||||
|
||||
|
@ -31,7 +31,7 @@ The source code
|
||||
|
||||
You may also find the source code and these video file in the
|
||||
`samples/cpp/tutorial_code/videoio/video-write/` folder of the OpenCV source library or [download it
|
||||
from here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/videoio/video-write/video-write.cpp).
|
||||
from here ](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/videoio/video-write/video-write.cpp).
|
||||
|
||||
@include cpp/tutorial_code/videoio/video-write/video-write.cpp
|
||||
|
||||
|
@ -12,7 +12,7 @@ In this tutorial you will learn how to
|
||||
Code
|
||||
----
|
||||
|
||||
You can download the code from [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/viz/creating_widgets.cpp).
|
||||
You can download the code from [here ](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/viz/creating_widgets.cpp).
|
||||
@include samples/cpp/tutorial_code/viz/creating_widgets.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -14,7 +14,7 @@ In this tutorial you will learn how to
|
||||
Code
|
||||
----
|
||||
|
||||
You can download the code from [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/viz/launching_viz.cpp).
|
||||
You can download the code from [here ](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/viz/launching_viz.cpp).
|
||||
@include samples/cpp/tutorial_code/viz/launching_viz.cpp
|
||||
|
||||
Explanation
|
||||
|
@ -13,7 +13,7 @@ In this tutorial you will learn how to
|
||||
Code
|
||||
----
|
||||
|
||||
You can download the code from [here ](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/viz/transformations.cpp).
|
||||
You can download the code from [here ](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/viz/transformations.cpp).
|
||||
@include samples/cpp/tutorial_code/viz/transformations.cpp
|
||||
|
||||
Explanation
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user