URLs of interest:
http://www.huge-man-linux.net/man1/opencv-createsamples.html
#include "FiveWin.ch"
#define WINDOW_AUTOSIZE 1
function Main()
local hMat := cv_ImRead( "007.jpg" )
cv_namedWindow( "window title", WINDOW_AUTOSIZE )
cv_ImShow( "window title", hMat )
cv_WaitKey()
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <opencv.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc.hpp>
static cv::Mat mat1;
HB_FUNC( CV_IMREAD )
{
cv::CascadeClassifier face_cascade;
std::vector<cv::Rect> faces;
face_cascade.load( "c:/opencv/sources/data/haarcascades/haarcascade_eye.xml" );
mat1 = cv::imread( hb_parc( 1 ) );
face_cascade.detectMultiScale( mat1, faces, 1.1, 3, 0, cv::Size( 30, 60 ) );
for( size_t i = 0; i < faces.size(); i++ )
cv::rectangle( mat1, faces[ i ], cv::Scalar( 255, 255, 255 ), 1, 1, 0 );
hb_retptr( &mat1 );
}
HB_FUNC( CV_NAMEDWINDOW )
{
cv::namedWindow( hb_parc( 1 ), hb_parnl( 2 ) );
}
HB_FUNC( CV_IMSHOW )
{
cv::imshow( hb_parc( 1 ), * ( ( cv::Mat * ) hb_parptr( 2 ) ) );
}
HB_FUNC( CV_WAITKEY )
{
cv::waitKey( hb_parnl( 1 ) );
}
#pragma ENDDUMP
To support this tutorial, several official OpenCV applications will be used: opencv_createsamples, opencv_annotation, opencv_traincascade and opencv_visualisation.
Createsamples, traincascade and opencv_haartraining are deprecated
Positive samples are created by the opencv_createsamples application
1. You can generate a bunch of positives from a single positive object image.
2. You can supply all the positives yourself and only use the tool to cut them out, resize them and put them in the opencv needed binary format.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include\ostream(410): warning C4530: Se ha utilizado el controlador de excepciones de C++, pero la semántica de desenredo no está habilitada. Especifique /EHsc
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include\ostream(403): note: al compilar la función del miembro clase plantilla "std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(double)"
C:\opencv\build\include\opencv2/core/utility.hpp(400): note: Vea la referencia a la creación de una instancia de la función plantilla "std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(double)" que se está compilando
C:\opencv\build\include\opencv2/core/cvstd.inl.hpp(82): note: Vea la referencia a la creación de una instancia de clase plantilla "std::basic_ostream<char,std::char_traits<char>>" que se está compilando
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: FAST WebCrawler [Crawler], Google [Bot] and 57 guests