-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
text: cleanup dnn text detection part
- Loading branch information
Showing
19 changed files
with
308 additions
and
2,898 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,24 @@ | ||
set(the_description "Text Detection and Recognition") | ||
|
||
if(POLICY CMP0023) | ||
message(STATUS "Explicitly setting policy CMP0023 to OLD") | ||
cmake_policy(SET CMP0023 OLD) | ||
endif(POLICY CMP0023) | ||
|
||
# Using cmake scripts and modules | ||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
set(TEXT_DEPS opencv_ml opencv_highgui opencv_imgproc opencv_core opencv_features2d opencv_calib3d) | ||
|
||
find_package(Caffe) | ||
if(Caffe_FOUND) | ||
message(STATUS "Caffe: YES") | ||
set(HAVE_CAFFE 1) | ||
else() | ||
message(STATUS "Caffe: NO") | ||
# list(APPEND TEXT_DEPS opencv_dnn) | ||
endif() | ||
|
||
#internal dependencies | ||
find_package(Protobuf) | ||
if(Protobuf_FOUND) | ||
message(STATUS "Protobuf: YES") | ||
set(HAVE_PROTOBUF 1) | ||
else() | ||
message(STATUS "Protobuf: NO") | ||
endif() | ||
|
||
find_package(Glog) | ||
if(Glog_FOUND) | ||
message(STATUS "Glog: YES") | ||
set(HAVE_GLOG 1) | ||
else() | ||
message(STATUS "Glog: NO") | ||
endif() | ||
|
||
ocv_define_module(text opencv_ml opencv_imgproc opencv_core opencv_features2d opencv_calib3d OPTIONAL opencv_dnn WRAP python) | ||
#ocv_define_module(text ${TEXT_DEPS} WRAP python) | ||
|
||
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
||
find_package(Tesseract) | ||
if(${Tesseract_FOUND}) | ||
message(STATUS "Tesseract: YES") | ||
include_directories(${Tesseract_INCLUDE_DIR}) | ||
target_link_libraries(opencv_text ${Tesseract_LIBS}) | ||
add_definitions(-DHAVE_TESSERACT) | ||
else() | ||
message(STATUS "Tesseract: NO") | ||
ocv_define_module(text opencv_ml opencv_imgproc opencv_core opencv_features2d opencv_dnn OPTIONAL opencv_highgui WRAP python java) | ||
|
||
if(NOT CMAKE_CROSSCOMPILING OR OPENCV_FIND_TESSERACT) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | ||
find_package(Tesseract QUIET) | ||
if(Tesseract_FOUND) | ||
message(STATUS "Tesseract: YES") | ||
set(HAVE_TESSERACT 1) | ||
ocv_include_directories(${Tesseract_INCLUDE_DIR}) | ||
ocv_target_link_libraries(${the_module} ${Tesseract_LIBRARIES}) | ||
else() | ||
message(STATUS "Tesseract: NO") | ||
endif() | ||
endif() | ||
|
||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/text_config.hpp.in | ||
${CMAKE_BINARY_DIR}/text_config.hpp @ONLY) | ||
|
||
if(HAVE_CAFFE AND HAVE_GLOG AND HAVE_PROTOBUF) | ||
include_directories(${Caffe_INCLUDE_DIR}) | ||
find_package(HDF5 COMPONENTS HL REQUIRED) | ||
include_directories(SYSTEM ${HDF5_INCLUDE_DIRS} ${HDF5_HL_INCLUDE_DIR}) | ||
list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES}) | ||
find_package(Boost 1.46 REQUIRED COMPONENTS system thread filesystem) | ||
include_directories(SYSTEM ${Boost_INCLUDE_DIR}) | ||
include_directories(SYSTEM ${CUDA_INCLUDE_DIR}) | ||
link_directories(SYSTEM ${CUDA_LIBS}) | ||
# include_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/include/ usr/local/cuda-8.0/include/ /usr/local/cuda-7.5/targets/x86_64-linux/include/ ) | ||
#link_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/lib/ usr/local/cuda-8.0/lib/ /usr/local/cuda-7.5/targets/x86_64-linux/lib/ /usr/lib/openblas-base/lib /usr/local/cuda-8.0/lib64) | ||
list(APPEND Caffe_LINKER_LIBS ${Boost_LIBRARIES}) | ||
target_link_libraries(opencv_text atlas blas ${Caffe_LIBS} ${Glog_LIBS} ${Protobuf_LIBS} ${HDF5_LIBRARIES} ${Boost_LIBRARIES}) | ||
add_definitions(-DHAVE_CAFFE) | ||
endif() #HAVE_CAFFE | ||
|
||
message(STATUS "TEXT CAFFE SEARCH") | ||
if() | ||
message(STATUS "TEXT NO CAFFE CONFLICT") | ||
else() | ||
message(STATUS "TEXT CAFFE CONFLICT") | ||
endif() | ||
ocv_include_directories(${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
if(HAVE_opencv_dnn) | ||
message(STATUS "dnn module found") | ||
add_definitions(-DHAVE_DNN) | ||
set(HAVE_DNN 1) | ||
else() | ||
message(STATUS "dnn module not found") | ||
endif() | ||
ocv_add_testdata(samples/ contrib/text | ||
FILES_MATCHING PATTERN "*.xml" PATTERN "*.xml.gz" REGEX "scenetext[0-9]+.jpg" | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.