feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake

1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试
2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程
3.重整权利声明文件,重整代码工程,确保最小化侵权风险

Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake
Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
This commit is contained in:
wangzhengyang
2022-05-10 09:54:44 +08:00
parent ecdd171c6f
commit 718c41634f
10018 changed files with 3593797 additions and 186748 deletions

View File

@ -0,0 +1,102 @@
#!/bin/bash
##################################################################################################
#
# This script checks for the required Debian packages are installed
# to build OpenCV.
# Commandline parameters:
# $@ These are the names of the packages to check with 'dpkg'. Multiple values may
# be specified per package by using pipe as a delimiter, e.g. libpng-dev|libpng12-dev.
# Multiple values are evaluated left-to-right and the first found prevents checking of
# the remaining package options.
#
# -o <package_name> Specifying this switch with a package name marks it as optional
# i.e. it is not required to be installed.
#
# Returns:
# 0 - All packages installed (success)
# 1 - One or more packages missing (failure)
#
# Kerry Billingham <contact (at) avionicengineers (d0t) com>
# 20 April 2016
#
##################################################################################################
red=$'\e[1;31m'
green=$'\e[1;32m'
yellow=$'\e[1;33m'
end=$'\e[0m'
check_message="Checking for "
declare -i packageMissing=0
declare -i installed=1
#########################
# Function declarations.
#########################
function check_package() {
check_message="Checking for package "
dpkg -s $1 &>/dev/null
is_installed=$?
if [ ${is_installed} -ne 0 ]; then
printf "%-80s%s\n" "$2${check_message}${red}$1" " MISSING.${end}"
packageMissing=1
else
printf "%-80s%s\n" "$2${check_message}${green}$1" " INSTALLED.${end}"
packageMissing=0
fi
return $is_installed
}
# Main part of script.
ORIGINAL_IFS=$IFS
dpkg -? &>/dev/null
if [ $? -ne 0 ]; then
printf "%-80s%s\n" "${check_message} ${red}'dpkg'" " MISSING.${end}"
exit 1
else
printf "%-80s%s\n" "${check_message} ${green}'dpkg'" " INSTALLED.${end}"
fi
while getopts o: option; do
case $option in
o)
IFS="|"
packageChoices=( ${OPTARG} )
if [ ${#packageChoices[@]} -gt 1 ]; then
echo "Optional package. One of ${yellow}${packageChoices[@]}${end} can be installed."
for choice in ${packageChoices[@]}; do
check_package ${choice} " "
if [ $? -eq 0 ]; then
break
fi
done
else
echo "Optional package ${yellow}${packageChoices}${end}"
check_package ${OPTARG} " "
fi
IFS=$ORIGINAL_IFS
;;
\?)
echo "No option found"
;;
esac
done
shift $((OPTIND-1))
packageArray=( $@ )
for package in ${packageArray[@]}; do
IFS="|"
packageChoices=( ${package} )
if [ ${#packageChoices[@]} -gt 1 ]; then
echo "Multiple options. One of ${yellow}${packageChoices[@]}${end} must be installed."
for choice in ${packageChoices[@]}; do
check_package ${choice} " "
if [ $? -eq 0 ]; then
break
fi
done
else
check_package ${package} ""
fi
done
exit $packageMissing

View File

@ -0,0 +1,32 @@
#!/bin/bash
##################################################################
#
# This script will clear the executable flag on
# the specified library and then check it has
# been cleared as a separate operation.
#
# $1 - The absolute path to the OpenCV native library.
#
# Returns:
# 0 - The executable flag has been cleared
# 1 - The executable flag could NOT be cleared (failure).
#
# Kerry Billingham <contact (at) avionicengineers (d0t) com>
# 11 March 2017
#
##################################################################
red=$'\e[1;31m'
green=$'\e[1;32m'
end=$'\e[0m'
echo "${green}[INFO] Checking that the native library executable stack flag is NOT set.${end}"
BINARY=execstack
$BINARY --help > /dev/null || BINARY=/usr/sbin/execstack
$BINARY -c $1
$BINARY -q $1 | grep -o ^-
if [ $? -ne 0 ]; then
echo
echo "${red}[ERROR] The Executable Flag could not be cleared on the library $1.${end}"
exit 1
fi
exit 0

View File

@ -0,0 +1,21 @@
#!/bin/bash
###############################################################
#
# Defines some common functions.
#
# Kerry Billingham <contact [At] AvionicEngineers.{com]>
#
##############################################################
majorHashDefine="#define CV_VERSION_MAJOR"
minorHashDefine="#define CV_VERSION_MINOR"
revisionHashDefine="#define CV_VERSION_REVISION"
statusHashDefine="#define CV_VERSION_STATUS"
versionHeader="../../../../modules/core/include/opencv2/core/version.hpp"
function extract_version() {
minorVersion=$(grep "${minorHashDefine}" $versionHeader | grep -o ".$")
majorVersion=$(grep "${majorHashDefine}" $versionHeader | grep -o ".$")
revision=$(grep "${revisionHashDefine}" $versionHeader | grep -o ".$")
REPLY="${majorVersion}.${minorVersion}.${revision}"
}

View File

@ -0,0 +1,86 @@
#!/bin/bash
#####################################################################
# This script extracts several properties and then writes them to a
# to a file, 'build.properties'. These properties include:
#
# 1. OpenCV version.
# 2. OpenVC version as a string for use by Maven.
# 3. The CPU binary word size.
# 4. Architecture string.
# 4. OSGi compatible CPU architecture string.
#
# There is no need to execute this script directly as it will be
# called during the Maven build process.
#
# Command-line parameters:
# $1 - The build directory and where the output file will be written
# $2 - The name of the output file to write to.
#
# Returns:
# 0 - Successfully written the properties file.
# 1 - Error occurred such as build directory does not exist
# or OpenCV version could not be determined or an
# unexpected error.
#
# Kerry Billingham <contact (at) avionicengineers (d0t) com>
# 20 April 2016
#
#####################################################################
# Include some external functions and variables
. ./functions
#Test build directory exists
if [ ! -n "$1" ] || [ ! -d $1 ];then
echo "Build directory not specified or does not exist!"
exit 1
fi
if [ -n "${versionHeader}" ] && [ -e ${versionHeader} ];then
extract_version
bits=$(getconf LONG_BIT)
architecture=$(arch)
osgiProcessor="Not Set"
case ${architecture} in
x86*)
echo "This is x86 (32 | 64) bit"
case ${bits} in
32)
osgiProcessor="x86"
;;
64)
osgiProcessor="x86_64"
;;
*)
osgiProcessor="Unknown"
esac
;;
arm*)
echo "This is ARM"
byteOrder=$(lscpu | grep -i "byte order")
shopt -s nocasematch
if [[ "${byteOrder}" == *little* ]]; then
osgiProcessor="arm_le"
elif [[ "${byteOrder}}" == *big* ]]; then
osgiProcessor="arm_be"
fi
shopt -u nocasematch
;;
*)
echo "This is unknown architecture"
esac
echo "The version number will be ${majorVersion}.${minorVersion}.${revision}"
echo "opencv.version=${majorVersion}.${minorVersion}.${revision}" > ${1}/${2}
echo "lib.version.string=${majorVersion}${minorVersion}${revision}" >> ${1}/${2}
echo "bits=${bits}" >> ${1}/${2}
echo "architecture=$(arch)" >> ${1}/${2}
echo "osgi.processor=${osgiProcessor}" >> ${1}/${2}
exit 0
else
echo "Could not locate file ${versionHeader} to determine versioning."
exit 1
fi