Skip to content

Commit 68e9d1a

Browse files
committed
+ README
1 parent 7db8322 commit 68e9d1a

38 files changed

+95
-85039
lines changed

CMakeLists.txt

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ IF (DEBUG_CLI)
66
ADD_DEFINITIONS(-DDEBUG_CLI)
77
ENDIF (DEBUG_CLI)
88

9-
ENABLE_TESTING()
9+
#ENABLE_TESTING()
1010

1111
# This has to go quite early on, as otherwise we risk picking
1212
# up an identically named header from a system include path.
@@ -290,18 +290,18 @@ LINK_DIRECTORIES(${Qt5LinguistTools_LIBRARIES})
290290

291291
#=================================== OpenCV ===================================#
292292

293-
IF (FALSE)
294-
find_package(OpenCV PATHS opencv_dir_ REQUIRED)
295-
IF (NOT OpenCV_FOUND)
296-
MESSAGE(
297-
FATAL_ERROR
298-
"Could not find OpenCV headers or libraries.\n"
299-
)
300-
ENDIF ()
301293

302-
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
303-
LINK_DIRECTORIES(${OpenCV_LIBRARIES})
304-
ENDIF (FALSE)
294+
# find_package(OpenCV PATHS opencv_dir_ REQUIRED)
295+
# IF (NOT OpenCV_FOUND)
296+
# MESSAGE(
297+
# FATAL_ERROR
298+
# "Could not find OpenCV headers or libraries.\n"
299+
# )
300+
# ENDIF ()
301+
#
302+
# INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
303+
# LINK_DIRECTORIES(${OpenCV_LIBRARIES})
304+
305305

306306
#=================================== Main ===================================#
307307

@@ -325,7 +325,7 @@ ADD_SUBDIRECTORY(math)
325325
ADD_SUBDIRECTORY(imageproc)
326326
ADD_SUBDIRECTORY(interaction)
327327
ADD_SUBDIRECTORY(zones)
328-
ADD_SUBDIRECTORY(tests)
328+
#ADD_SUBDIRECTORY(tests)
329329

330330
FILE(GLOB common_ui_files ui/ErrorWidget.ui)
331331
FILE(GLOB gui_only_ui_files "ui/*.ui")
@@ -430,6 +430,9 @@ SET(
430430
FileNameDisambiguator.cpp FileNameDisambiguator.h
431431
OpenGLSupport.cpp OpenGLSupport.h
432432
OutputFileNameGenerator.cpp OutputFileNameGenerator.h
433+
DarkScheme.cpp DarkScheme.h
434+
LightScheme.cpp LightScheme.h
435+
ColorSchemeManager.cpp ColorSchemeManager.h
433436
PageRange.cpp PageRange.h
434437
SelectedPage.cpp SelectedPage.h
435438
Utils.cpp Utils.h
@@ -456,9 +459,6 @@ SET(
456459
SET(
457460
gui_only_sources
458461
Application.cpp Application.h
459-
DarkScheme.cpp DarkScheme.h
460-
LightScheme.cpp LightScheme.h
461-
ColorSchemeManager.cpp ColorSchemeManager.h
462462
SkinnedButton.cpp SkinnedButton.h
463463
RelinkablePathVisualization.cpp RelinkablePathVisualization.h
464464
RelinkingModel.cpp RelinkingModel.h
@@ -522,7 +522,7 @@ ADD_EXECUTABLE(
522522
${resource_sources} ${win32_resource_file} resources/icons/COPYING
523523
)
524524

525-
ADD_EXECUTABLE(scantailor-cli ${cli_only_sources} ${common_ui_sources})
525+
#ADD_EXECUTABLE(scantailor-cli ${cli_only_sources} ${common_ui_sources})
526526

527527
TARGET_LINK_LIBRARIES(
528528
scantailor
@@ -532,27 +532,28 @@ TARGET_LINK_LIBRARIES(
532532
${Qt5OpenGL_LIBRARIES} ${Qt5LinguistTools_LIBRARIES} ${EXTRA_LIBS}
533533
# ${OpenCV_LIBRARIES}
534534
)
535-
TARGET_LINK_LIBRARIES(
536-
scantailor-cli
537-
fix_orientation page_split deskew select_content page_layout output
538-
stcore dewarping zones interaction imageproc math foundation
539-
${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Network_LIBRARIES}
540-
${Qt5LinguistTools_LIBRARIES} ${EXTRA_LIBS}
541-
# ${OpenCV_LIBRARIES}
542-
)
535+
#TARGET_LINK_LIBRARIES(
536+
# scantailor-cli
537+
# fix_orientation page_split deskew select_content page_layout output
538+
# stcore dewarping zones interaction imageproc math foundation
539+
# ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Network_LIBRARIES}
540+
# ${Qt5LinguistTools_LIBRARIES} ${EXTRA_LIBS}
541+
# # ${OpenCV_LIBRARIES}
542+
#)
543543

544544
if (WIN32)
545545
TARGET_LINK_LIBRARIES(
546546
scantailor
547547
wsock32 ws2_32
548548
)
549-
TARGET_LINK_LIBRARIES(
550-
scantailor-cli
551-
wsock32 ws2_32
552-
)
549+
# TARGET_LINK_LIBRARIES(
550+
# scantailor-cli
551+
# wsock32 ws2_32
552+
# )
553553
endif ()
554554

555-
INSTALL(TARGETS scantailor scantailor-cli RUNTIME DESTINATION bin)
555+
#INSTALL(TARGETS scantailor scantailor-cli RUNTIME DESTINATION bin)
556+
INSTALL(TARGETS scantailor RUNTIME DESTINATION bin)
556557

557558
# Translations
558559
TRANSLATION_SOURCES(scantailor ${sources} ${ui_files})

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ brings new ones and fixes.
88
#### <u>Contents</u>:
99
* [Description](#description)
1010
* [Features](#features)
11-
* [**Scan Tailor Enhanced** features](#**scan-tailor-enhanced**-features)
11+
* [**Scan Tailor Enhanced** features](#scan-tailor-enhanced-features)
1212
* [Auto margins](#auto-margins)
1313
* [Page detect](#page-detect)
1414
* [Deviation](#deviation)
1515
* [Picture shape](#picture-shape)
1616
* [Tiff compression](#tiff-compression)
17-
* [Multi column thumbnails view \[reworked\]](#multi-column-thumbnails-view-\[reworked\])
18-
* [**Scan Tailor Featured** features](#**scan-tailor-featured**-features)
17+
* [Multi column thumbnails view \[reworked\]](#multi-column-thumbnails-view-reworked)
18+
* [**Scan Tailor Featured** features](#scan-tailor-featured-features)
1919
* [Scan Tailor Featured fixes](#scan-tailor-featured-fixes)
2020
* [Line vertical dragging on dewarp](#line-vertical-dragging-on-dewarp)
2121
* [Square picture zones](#square-picture-zones)
22-
* [Auto save project \[optimized\]](#auto-save-project-\[optimized\])
22+
* [Auto save project \[optimized\]](#auto-save-project-optimized)
2323
* [Quadro Zoner](#quadro-zoner)
2424
* [Marginal dewarping](#marginal-dewarping)
25-
* [**Scan Tailor Advanced** features](#**scan-tailor-advanced**-features)
25+
* [**Scan Tailor Advanced** features](#scan-tailor-advanced-features)
2626
* [Scan Tailor Advanced fixes](#scan-tailor-advanced-fixes)
2727
* [Light and Dark color schemes](#light-and-dark-color-schemes)
2828
* [Multi-threading support for batch processing](#multi-threading-support-for-batch-processing)
2929
* [Full control over settings on output](#full-control-over-settings-on-output)
3030
* [Adaptive binarization](#adaptive-binarization)
3131
* [Splitting output](#splitting-output)
32-
* Building (work on the section in progress)
32+
* [Building](#building)
3333

3434
Description
3535
------------
@@ -112,8 +112,8 @@ Features
112112
*This feature had performance issues and has been optimized.*
113113

114114
* ##### Quadro Zoner
115-
Another rectangular picture zone shape. This option is based on [Picture shape](picture-shape),
116-
[Square picture zones](square-picture-zones). It squeezes every Picture shape zone down to the real
115+
Another rectangular picture zone shape. This option is based on [Picture shape](#picture-shape),
116+
[Square picture zones](#square-picture-zones). It squeezes every Picture shape zone down to the real
117117
rectangular picture outline and then replaces it (the resulting raster zone) by a vector rectangular zone,
118118
so that a user could easily adjust it afterwards (by moving its corners in an orthogonal manner).
119119

@@ -143,7 +143,7 @@ Features
143143

144144
4. Optimized memory usage on the output stage.
145145

146-
5. Reworking on [Multi column thumbnails view](#multi-column-thumbnails-view-\[reworked\])
146+
5. Reworking on [Multi column thumbnails view](#multi-column-thumbnails-view-reworked)
147147
feature from ver. Enhanced.
148148
Now thumbnails is shown evenly.
149149

@@ -153,6 +153,7 @@ Features
153153
* ##### Multi-threading support for batch processing
154154
This significantly increases the speed of processing. The count of threads to use can be
155155
adjusted while processing.
156+
156157
**Warning!** More threads requires more memory to use. Exclude situations of that to be overflowed.
157158

158159
* ##### Full control over settings on output
@@ -168,12 +169,17 @@ Features
168169
The feature allows to split the mixed output scans into the pairs of a foreground (letters)
169170
and background (images) layer.
170171

171-
You can choose between B&W or Color foreground.
172+
You can choose between B&W or color (original) foreground.
172173

173174
It can be useful:
174-
- for the further DjVu encoding,
175-
- to apply different filters to letters and images, which when being applied to the whole
176-
image gives worse results.
175+
- for the further DjVu encoding,
176+
- to apply different filters to letters and images, which when being applied to the whole
177+
image gives worse results.
177178

178-
This does not rename files to 0001, 0002... It can be made by a third party app, for example
179-
[Bulk Rename Utility](http://www.bulkrenameutility.co.uk/Main_Intro.php)
179+
*Note: That does not rename files to 0001, 0002... It can be made by a third party app, for example
180+
[Bulk Rename Utility](http://www.bulkrenameutility.co.uk/Main_Intro.php)*
181+
182+
Building
183+
----------
184+
185+
Go to [this repository](https://github.com/4lex4/scantailor-libs-build) and follow the instructions given there.

WorkerThreadPool.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,17 @@ void WorkerThreadPool::customEvent(QEvent* event) {
105105
}
106106

107107
void WorkerThreadPool::updateNumberOfThreads() {
108-
int max_threads = QThread::idealThreadCount();
108+
int max_threads;
109+
if (sizeof(void*) <= 4) {
110+
// Restricting num of processors for 32-bit due to
111+
// address space constraints.
112+
max_threads = QThread::idealThreadCount();
113+
if (max_threads > 2) {
114+
max_threads = 2;
115+
}
116+
} else {
117+
max_threads = QThread::idealThreadCount();
118+
}
109119

110120
int num_threads = m_settings.value("settings/batch_processing_threads", max_threads).toInt();
111121
num_threads = std::min<int>(num_threads, max_threads);

imageproc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ SOURCE_GROUP(Sources FILES ${sources})
5656

5757
ADD_LIBRARY(imageproc STATIC ${sources})
5858

59-
ADD_SUBDIRECTORY(tests)
59+
#ADD_SUBDIRECTORY(tests)

math/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ SOURCE_GROUP("Sources\\Differentiation Framework" FILES ${ADIFF_SOURCES})
4545

4646
ADD_LIBRARY(math STATIC ${GENERIC_SOURCES} ${SPFIT_SOURCES} ${ADIFF_SOURCES})
4747

48-
ADD_SUBDIRECTORY(spfit/tests)
49-
ADD_SUBDIRECTORY(adiff/tests)
48+
#ADD_SUBDIRECTORY(spfit/tests)
49+
#ADD_SUBDIRECTORY(adiff/tests)

math/adiff/tests/TestHessians.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
#include "Function.h"
2020
#include <boost/test/auto_unit_test.hpp>
21+
#include <boost/test/floating_point_comparison.hpp>
22+
#include <stdlib.h>
23+
#include <math.h>
2124

2225
namespace adiff {
2326
namespace tests {

math/spfit/tests/TestSqDistApproximant.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818

1919
#include "SqDistApproximant.h"
2020
#include "ToLineProjector.h"
21+
#include <QPointF>
22+
#include <QLineF>
2123
#include <boost/test/auto_unit_test.hpp>
24+
#include <boost/test/floating_point_comparison.hpp>
25+
#include <stdlib.h>
26+
#include <math.h>
2227

2328
namespace spfit {
2429
namespace tests {

tests/TestContentSpanFinder.cpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818

1919
#include "ContentSpanFinder.h"
2020
#include "imageproc/SlicedHistogram.h"
21-
#include <boost/lambda/lambda.hpp>
22-
#include <boost/lambda/bind.hpp>
21+
#include <vector>
2322
#include <boost/test/auto_unit_test.hpp>
2423

2524
namespace Tests {
26-
using namespace boost::lambda;
2725
using namespace imageproc;
2826

2927
BOOST_AUTO_TEST_SUITE(ContentSpanFinderTestSuite);
@@ -34,7 +32,10 @@ namespace Tests {
3432
std::vector<Span> spans;
3533
span_finder.find(
3634
SlicedHistogram(),
37-
bind(&std::vector<Span>::push_back, var(spans), _1)
35+
[&](Span const& span)
36+
{
37+
spans.push_back(span);
38+
}
3839
);
3940

4041
BOOST_CHECK(spans.empty());
@@ -57,7 +58,11 @@ namespace Tests {
5758
span_finder.setMinContentWidth(2);
5859

5960
std::vector<Span> spans;
60-
span_finder.find(hist, bind(&std::vector<Span>::push_back, var(spans), _1));
61+
span_finder.find(hist, [&](Span const& span)
62+
{
63+
spans.push_back(span);
64+
}
65+
);
6166

6267
BOOST_REQUIRE(spans.size() == 2);
6368
BOOST_REQUIRE(spans[0] == Span(3, 3 + 3));
@@ -81,7 +86,11 @@ namespace Tests {
8186
span_finder.setMinWhitespaceWidth(2);
8287

8388
std::vector<Span> spans;
84-
span_finder.find(hist, bind(&std::vector<Span>::push_back, var(spans), _1));
89+
span_finder.find(hist, [&](Span const& span)
90+
{
91+
spans.push_back(span);
92+
}
93+
);
8594

8695
BOOST_REQUIRE(spans.size() == 2);
8796
BOOST_REQUIRE(spans[0] == Span(1, 1 + 4));
@@ -106,7 +115,11 @@ namespace Tests {
106115
span_finder.setMinWhitespaceWidth(2);
107116

108117
std::vector<Span> spans;
109-
span_finder.find(hist, bind(&std::vector<Span>::push_back, var(spans), _1));
118+
span_finder.find(hist, [&](Span const& span)
119+
{
120+
spans.push_back(span);
121+
}
122+
);
110123

111124

112125
BOOST_REQUIRE(spans.size() == 1);

tests/TestMatrixCalc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "MatrixCalc.h"
2020
#include <boost/test/auto_unit_test.hpp>
21+
#include <boost/test/floating_point_comparison.hpp>
2122

2223
namespace imageproc {
2324
namespace tests {

0 commit comments

Comments
 (0)