feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试 2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程 3.重整权利声明文件,重整代码工程,确保最小化侵权风险 Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
This commit is contained in:
		
							
								
								
									
										26
									
								
								3rdparty/opencv-4.5.4/samples/cpp/example_cmake/CMakeLists.txt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								3rdparty/opencv-4.5.4/samples/cpp/example_cmake/CMakeLists.txt
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,26 @@
 | 
			
		||||
# cmake needs this line
 | 
			
		||||
cmake_minimum_required(VERSION 3.1)
 | 
			
		||||
 | 
			
		||||
# Define project name
 | 
			
		||||
project(opencv_example_project)
 | 
			
		||||
 | 
			
		||||
# Find OpenCV, you may need to set OpenCV_DIR variable
 | 
			
		||||
# to the absolute path to the directory containing OpenCVConfig.cmake file
 | 
			
		||||
# via the command line or GUI
 | 
			
		||||
find_package(OpenCV REQUIRED)
 | 
			
		||||
 | 
			
		||||
# If the package has been found, several variables will
 | 
			
		||||
# be set, you can find the full list with descriptions
 | 
			
		||||
# in the OpenCVConfig.cmake file.
 | 
			
		||||
# Print some message showing some of them
 | 
			
		||||
message(STATUS "OpenCV library status:")
 | 
			
		||||
message(STATUS "    config: ${OpenCV_DIR}")
 | 
			
		||||
message(STATUS "    version: ${OpenCV_VERSION}")
 | 
			
		||||
message(STATUS "    libraries: ${OpenCV_LIBS}")
 | 
			
		||||
message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")
 | 
			
		||||
 | 
			
		||||
# Declare the executable target built from your sources
 | 
			
		||||
add_executable(opencv_example example.cpp)
 | 
			
		||||
 | 
			
		||||
# Link your application with OpenCV libraries
 | 
			
		||||
target_link_libraries(opencv_example PRIVATE ${OpenCV_LIBS})
 | 
			
		||||
							
								
								
									
										12
									
								
								3rdparty/opencv-4.5.4/samples/cpp/example_cmake/Makefile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								3rdparty/opencv-4.5.4/samples/cpp/example_cmake/Makefile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
CXX ?= g++
 | 
			
		||||
 | 
			
		||||
CXXFLAGS += -c -Wall $(shell pkg-config --cflags opencv)
 | 
			
		||||
LDFLAGS += $(shell pkg-config --libs --static opencv)
 | 
			
		||||
 | 
			
		||||
all: opencv_example
 | 
			
		||||
 | 
			
		||||
opencv_example: example.o; $(CXX) $< -o $@ $(LDFLAGS)
 | 
			
		||||
 | 
			
		||||
%.o: %.cpp; $(CXX) $< -o $@ $(CXXFLAGS)
 | 
			
		||||
 | 
			
		||||
clean: ; rm -f example.o opencv_example
 | 
			
		||||
							
								
								
									
										50
									
								
								3rdparty/opencv-4.5.4/samples/cpp/example_cmake/example.cpp
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								3rdparty/opencv-4.5.4/samples/cpp/example_cmake/example.cpp
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
#include "opencv2/core.hpp"
 | 
			
		||||
#include "opencv2/imgproc.hpp"
 | 
			
		||||
#include "opencv2/highgui.hpp"
 | 
			
		||||
#include "opencv2/videoio.hpp"
 | 
			
		||||
#include <iostream>
 | 
			
		||||
 | 
			
		||||
using namespace cv;
 | 
			
		||||
using namespace std;
 | 
			
		||||
 | 
			
		||||
void drawText(Mat & image);
 | 
			
		||||
 | 
			
		||||
int main()
 | 
			
		||||
{
 | 
			
		||||
    cout << "Built with OpenCV " << CV_VERSION << endl;
 | 
			
		||||
    Mat image;
 | 
			
		||||
    VideoCapture capture;
 | 
			
		||||
    capture.open(0);
 | 
			
		||||
    if(capture.isOpened())
 | 
			
		||||
    {
 | 
			
		||||
        cout << "Capture is opened" << endl;
 | 
			
		||||
        for(;;)
 | 
			
		||||
        {
 | 
			
		||||
            capture >> image;
 | 
			
		||||
            if(image.empty())
 | 
			
		||||
                break;
 | 
			
		||||
            drawText(image);
 | 
			
		||||
            imshow("Sample", image);
 | 
			
		||||
            if(waitKey(10) >= 0)
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        cout << "No capture" << endl;
 | 
			
		||||
        image = Mat::zeros(480, 640, CV_8UC1);
 | 
			
		||||
        drawText(image);
 | 
			
		||||
        imshow("Sample", image);
 | 
			
		||||
        waitKey(0);
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void drawText(Mat & image)
 | 
			
		||||
{
 | 
			
		||||
    putText(image, "Hello OpenCV",
 | 
			
		||||
            Point(20, 50),
 | 
			
		||||
            FONT_HERSHEY_COMPLEX, 1, // font face and scale
 | 
			
		||||
            Scalar(255, 255, 255), // white
 | 
			
		||||
            1, LINE_AA); // line thickness and type
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user