feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试 2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程 3.重整权利声明文件,重整代码工程,确保最小化侵权风险 Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
This commit is contained in:
73
3rdparty/opencv-4.5.4/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp
vendored
Normal file
73
3rdparty/opencv-4.5.4/samples/cpp/tutorial_code/HighGUI/AddingImagesTrackbar.cpp
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @file AddingImagesTrackbar.cpp
|
||||
* @brief Simple linear blender ( dst = alpha*src1 + beta*src2 )
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <iostream>
|
||||
|
||||
using namespace cv;
|
||||
using std::cout;
|
||||
|
||||
/** Global Variables */
|
||||
const int alpha_slider_max = 100;
|
||||
int alpha_slider;
|
||||
double alpha;
|
||||
double beta;
|
||||
|
||||
/** Matrices to store images */
|
||||
Mat src1;
|
||||
Mat src2;
|
||||
Mat dst;
|
||||
|
||||
//![on_trackbar]
|
||||
/**
|
||||
* @function on_trackbar
|
||||
* @brief Callback for trackbar
|
||||
*/
|
||||
static void on_trackbar( int, void* )
|
||||
{
|
||||
alpha = (double) alpha_slider/alpha_slider_max ;
|
||||
beta = ( 1.0 - alpha );
|
||||
addWeighted( src1, alpha, src2, beta, 0.0, dst);
|
||||
imshow( "Linear Blend", dst );
|
||||
}
|
||||
//![on_trackbar]
|
||||
|
||||
/**
|
||||
* @function main
|
||||
* @brief Main function
|
||||
*/
|
||||
int main( void )
|
||||
{
|
||||
//![load]
|
||||
/// Read images ( both have to be of the same size and type )
|
||||
src1 = imread( samples::findFile("LinuxLogo.jpg") );
|
||||
src2 = imread( samples::findFile("WindowsLogo.jpg") );
|
||||
//![load]
|
||||
|
||||
if( src1.empty() ) { cout << "Error loading src1 \n"; return -1; }
|
||||
if( src2.empty() ) { cout << "Error loading src2 \n"; return -1; }
|
||||
|
||||
/// Initialize values
|
||||
alpha_slider = 0;
|
||||
|
||||
//![window]
|
||||
namedWindow("Linear Blend", WINDOW_AUTOSIZE); // Create Window
|
||||
//![window]
|
||||
|
||||
//![create_trackbar]
|
||||
char TrackbarName[50];
|
||||
sprintf( TrackbarName, "Alpha x %d", alpha_slider_max );
|
||||
createTrackbar( TrackbarName, "Linear Blend", &alpha_slider, alpha_slider_max, on_trackbar );
|
||||
//![create_trackbar]
|
||||
|
||||
/// Show some stuff
|
||||
on_trackbar( alpha_slider, 0 );
|
||||
|
||||
/// Wait until user press some key
|
||||
waitKey(0);
|
||||
return 0;
|
||||
}
|
73
3rdparty/opencv-4.5.4/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp
vendored
Normal file
73
3rdparty/opencv-4.5.4/samples/cpp/tutorial_code/HighGUI/BasicLinearTransformsTrackbar.cpp
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @file BasicLinearTransformsTrackbar.cpp
|
||||
* @brief Simple program to change contrast and brightness
|
||||
* @date Mon, June 6, 2011
|
||||
* @author OpenCV team
|
||||
*/
|
||||
|
||||
#include "opencv2/imgcodecs.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
// we're NOT "using namespace std;" here, to avoid collisions between the beta variable and std::beta in c++17
|
||||
using namespace cv;
|
||||
|
||||
/** Global Variables */
|
||||
const int alpha_max = 5;
|
||||
const int beta_max = 125;
|
||||
int alpha; /**< Simple contrast control */
|
||||
int beta; /**< Simple brightness control*/
|
||||
|
||||
/** Matrices to store images */
|
||||
Mat image;
|
||||
|
||||
/**
|
||||
* @function on_trackbar
|
||||
* @brief Called whenever any of alpha or beta changes
|
||||
*/
|
||||
static void on_trackbar( int, void* )
|
||||
{
|
||||
Mat new_image = Mat::zeros( image.size(), image.type() );
|
||||
|
||||
for( int y = 0; y < image.rows; y++ )
|
||||
for( int x = 0; x < image.cols; x++ )
|
||||
for( int c = 0; c < 3; c++ )
|
||||
new_image.at<Vec3b>(y,x)[c] = saturate_cast<uchar>( alpha*( image.at<Vec3b>(y,x)[c] ) + beta );
|
||||
|
||||
imshow("New Image", new_image);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @function main
|
||||
* @brief Main function
|
||||
*/
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
/// Read image given by user
|
||||
String imageName("lena.jpg"); // by default
|
||||
if (argc > 1)
|
||||
{
|
||||
imageName = argv[1];
|
||||
}
|
||||
image = imread( samples::findFile( imageName ) );
|
||||
|
||||
/// Initialize values
|
||||
alpha = 1;
|
||||
beta = 0;
|
||||
|
||||
/// Create Windows
|
||||
namedWindow("Original Image", 1);
|
||||
namedWindow("New Image", 1);
|
||||
|
||||
/// Create Trackbars
|
||||
createTrackbar( "Contrast", "New Image", &alpha, alpha_max, on_trackbar );
|
||||
createTrackbar( "Brightness", "New Image", &beta, beta_max, on_trackbar );
|
||||
|
||||
/// Show some stuff
|
||||
imshow("Original Image", image);
|
||||
imshow("New Image", image);
|
||||
|
||||
/// Wait until user press some key
|
||||
waitKey();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user