Commit fd10a462 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

parents 44087be0 7bba4cf0
...@@ -3,25 +3,24 @@ if(APPLE_FRAMEWORK) ...@@ -3,25 +3,24 @@ if(APPLE_FRAMEWORK)
ocv_module_disable(freetype) ocv_module_disable(freetype)
endif() endif()
if(PKG_CONFIG_FOUND) ocv_check_modules(FREETYPE freetype2)
pkg_search_module(FREETYPE freetype2) ocv_check_modules(HARFBUZZ harfbuzz)
pkg_search_module(HARFBUZZ harfbuzz)
endif()
if(NOT FREETYPE_FOUND) if(OPENCV_INITIAL_PASS)
message(STATUS "freetype2: NO") if(NOT FREETYPE_FOUND)
else() message(STATUS "freetype2: NO")
message(STATUS "freetype2: YES") else()
endif() message(STATUS "freetype2: YES (ver ${FREETYPE_VERSION})")
endif()
if(NOT HARFBUZZ_FOUND) if(NOT HARFBUZZ_FOUND)
message(STATUS "harfbuzz: NO") message(STATUS "harfbuzz: NO")
else() else()
message(STATUS "harfbuzz: YES") message(STATUS "harfbuzz: YES (ver ${HARFBUZZ_VERSION})")
endif()
endif() endif()
if(FREETYPE_FOUND AND HARFBUZZ_FOUND)
if( FREETYPE_FOUND AND HARFBUZZ_FOUND )
ocv_define_module(freetype opencv_core opencv_imgproc WRAP python) ocv_define_module(freetype opencv_core opencv_imgproc WRAP python)
ocv_target_link_libraries(${the_module} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES}) ocv_target_link_libraries(${the_module} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES})
ocv_include_directories( ${FREETYPE_INCLUDE_DIRS} ${HARFBUZZ_INCLUDE_DIRS} ) ocv_include_directories( ${FREETYPE_INCLUDE_DIRS} ${HARFBUZZ_INCLUDE_DIRS} )
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "../precomp.hpp" #include "../precomp.hpp"
#include "opencv2/calib3d.hpp" // findHomography #include "opencv2/calib3d.hpp" // findHomography
#include "opencv2/highgui.hpp"
#include "rlof_localflow.h" #include "rlof_localflow.h"
#include "berlof_invoker.hpp" #include "berlof_invoker.hpp"
#include "rlof_invoker.hpp" #include "rlof_invoker.hpp"
......
...@@ -2,10 +2,16 @@ set(the_description "Text Detection and Recognition") ...@@ -2,10 +2,16 @@ set(the_description "Text Detection and Recognition")
ocv_define_module(text opencv_ml opencv_imgproc opencv_core opencv_features2d opencv_dnn OPTIONAL opencv_highgui WRAP python java) 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) if(NOT CMAKE_CROSSCOMPILING OR OPENCV_FIND_TESSERACT)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) find_package(Tesseract QUIET) # Prefer CMake's standard locations (including Tesseract_DIR)
find_package(Tesseract QUIET) if(NOT Tesseract_FOUND)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindTesseract.cmake") # OpenCV's fallback
endif()
if(Tesseract_FOUND) if(Tesseract_FOUND)
message(STATUS "Tesseract: YES") if(Tesseract_VERSION)
message(STATUS "Tesseract: YES (ver ${Tesseract_VERSION})")
else()
message(STATUS "Tesseract: YES (ver unknown)")
endif()
set(HAVE_TESSERACT 1) set(HAVE_TESSERACT 1)
ocv_include_directories(${Tesseract_INCLUDE_DIRS}) ocv_include_directories(${Tesseract_INCLUDE_DIRS})
ocv_target_link_libraries(${the_module} ${Tesseract_LIBRARIES}) ocv_target_link_libraries(${the_module} ${Tesseract_LIBRARIES})
......
# Tesseract OCR # Tesseract OCR
if(COMMAND pkg_check_modules) ocv_check_modules(Tesseract tesseract) # lept is excluded (not a direct dependency)
pkg_check_modules(Tesseract tesseract lept)
endif()
if(NOT Tesseract_FOUND) if(NOT Tesseract_FOUND)
find_path(Tesseract_INCLUDE_DIR tesseract/baseapi.h find_path(Tesseract_INCLUDE_DIR tesseract/baseapi.h
HINTS HINTS
......
...@@ -364,9 +364,10 @@ static void rectifyPatch( const Mat& image, const KeyPoint& kp, ...@@ -364,9 +364,10 @@ static void rectifyPatch( const Mat& image, const KeyPoint& kp,
} }
else else
{ {
float M_[] = { const float s = scale_factor * (float)kp.size / (float)patchSize;
1.f, 0.f, -1.f * patchSize/2.0f + kp.pt.x, float M_[] = {
0.f, 1.f, -1.f * patchSize/2.0f + kp.pt.y s, 0.f, -s * patchSize/2.0f + kp.pt.x,
0.f, s, -s * patchSize/2.0f + kp.pt.y
}; };
M = Mat( 2, 3, CV_32FC1, M_ ).clone(); M = Mat( 2, 3, CV_32FC1, M_ ).clone();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment