Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

Scan Tailor Advanced

Scan Tailor specific announcements, releases, workflows, tips, etc. NO FEATURE REQUESTS IN THIS FORUM, please.
4lex4
Posts: 29
Joined: 15 Oct 2017, 12:35
Number of books owned: 0
Country: Russia

Re: Scan Tailor Advanced

Post by 4lex4 » 03 Jan 2018, 16:59


xerum
Posts: 40
Joined: 12 Jul 2015, 04:23
Number of books owned: 0
Country: australia

Re: Scan Tailor Advanced

Post by xerum » 05 Jan 2018, 07:15

Thank you Alex for the continued development and improvement of ST. I saw in the milestones that Dewarp is moving to 3rd stage.

Dewarp
Is it possible to make an option so people can select which stage they want Dewarp? As you know my thoughts already on this matter. i.e. Dewarp should be like good old ST was. i.e. after "select content". I agree that deskew in the 3rd stage but not dewarp.

ST experimental is great though could do with some of the features of ST Advanced. But one thing that i found did not flow was the dewarp.
My workflow logic is that Dewarp should occur after the selected content and not before you select the content.

The above is only my personal opinion after having frequently using of ST since late 2010.

Bug
Putting the above aside there is an intermittent bug in STA which is difficult to reproduce. In stage 6 output when i quickly select B&W or Grey scale/Color before allowing STA to complete the render it crashes. This only seems to rarely happen. I've been trying to reproduce it last few hours but now doesn't seem happen. v1.08 using Win7-64.

Content Selection
Thank you for fixing the cutting content bug. However i want to ask if it is possible to create a slider so one can choose the degree of how tight or how loose the content selection boundary works.

I have found that ST (all variants) sometimes miss (cut off) the footer (or header) on many or some pages but not all. I don't know why this is. I could not find any marks/artifacts speckles etc that may cause this. This is a pain as then one has to manually adjust the selection on the pages it missed to include footer/header/page number etc.

After much experimentation i found that if the footer or header is too close the edge of the page it is missed by the content selection. My quick fix is to add a 1CM or 2CM to the border of the scanned pagea and then re-running ST again. That works in 70% of cases.

Again thank you for listening and your continued efforts to further develop ST. It is very much appreciated.

Scanallthebooks
Posts: 38
Joined: 01 Dec 2016, 19:05
Number of books owned: 0
Country: Denmark

Re: Scan Tailor Advanced

Post by Scanallthebooks » 05 Jan 2018, 11:25

Content Selection
Thank you for fixing the cutting content bug. However i want to ask if it is possible to create a slider so one can choose the degree of how tight or how loose the content selection boundary works.
I have thought of this too. Perhaps a feature where you can add a user defined amount of pixels to the content selection box and be able to apply for all pages. Then you can run the automatic content selection and the afterwards just increase the box for all pages.

4lex4
Posts: 29
Joined: 15 Oct 2017, 12:35
Number of books owned: 0
Country: Russia

Re: Scan Tailor Advanced

Post by 4lex4 » 07 Jan 2018, 15:31

Bug
Putting the above aside there is an intermittent bug in STA which is difficult to reproduce. In stage 6 output when i quickly select B&W or Grey scale/Color before allowing STA to complete the render it crashes. This only seems to rarely happen. I've been trying to reproduce it last few hours but now doesn't seem happen. v1.08 using Win7-64.
I believe that crash happened when auto-margins feature from ver. Enhanced was enabled. It had the bad realization and crashed in multi-threaded environment. I fixed it a month ago while reworking that feature and added new features, adding to ST a new fast way to create margins for pages with similar formatting: commit. It will be available in 1.09

Orpheus2017
Posts: 2
Joined: 21 Jan 2018, 05:02
Number of books owned: 0
Country: United Kingdom

Re: Scan Tailor Advanced

Post by Orpheus2017 » 21 Jan 2018, 13:52

I am trying to compile Scan Tailor Advanced on OSX, and would great appreciate any pointers to make it happen. I should have all the dependencies on my system, currently I get stuck at 36%, with the following error:

Code: Select all

[ 36%] Building CXX object dewarping/CMakeFiles/dewarping.dir/DistortionModelBuilder.cpp.o
In file included from /Users/siavush/Downloads/scantailor-advanced-1.0.8/dewarping/DistortionModelBuilder.cpp:21:
In file included from /Users/siavush/Downloads/scantailor-advanced-1.0.8/dewarping/CylindricalSurfaceDewarper.h:22:
In file included from /Users/siavush/Downloads/scantailor-advanced-1.0.8/math/HomographicTransform.h:23:
/Users/siavush/Downloads/scantailor-advanced-1.0.8/math/MatrixCalc.h:153:16: error: calling a private constructor of class
      'mcalc::Mat<double>'
        return mcalc::Mat<T>(&m_alloc, data, rows, cols);
               ^
/Users/siavush/Downloads/scantailor-advanced-1.0.8/dewarping/DistortionModelBuilder.cpp:487:15: note: in instantiation of member
      function 'MatrixCalc<double, mcalc::DynamicPoolAllocator<double> >::operator()' requested here
            mc(&At[0], 2, polyline_size).transWrite(&A[0]);
              ^
/Users/siavush/Downloads/scantailor-advanced-1.0.8/math/MatrixCalc.h:130:9: note: declared private here
        Mat(AbstractAllocator<T>* alloc, T const* data, int rows, int cols)
        ^
1 error generated.
make[2]: *** [dewarping/CMakeFiles/dewarping.dir/DistortionModelBuilder.cpp.o] Error 1
make[1]: *** [dewarping/CMakeFiles/dewarping.dir/all] Error 2
make: *** [all] Error 2
Could anyone suggest a way forward? I have followed some previous suggestions to use gcc instead of clang, here is how the relevant part of my CMakelists.txt looks, after installing gcc using port:

Code: Select all

IF (UNIX)
    SET (CMAKE C COMPILER "/usr/local/Cellar/gcc/7.2.0_1/bin/x86_64-apple-darwin17.3.0-gcc-7")
    SET (CMAKE CXX COMPILER "/usr/local/Cellar/gcc/7.2.0_1/bin/x86_64-apple-darwin17.3.0-g++-7")
    set(CMAKE_CXX_STANDARD 11)
    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF ()

Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Scan Tailor Advanced

Post by Tulon » 21 Jan 2018, 16:44

Orpheus2017,

This commit should have fixed your issue. I am not sure if it made it into Scan Tailor Advanced or not. You can try applying it manually and see if it helps.
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.

4lex4
Posts: 29
Joined: 15 Oct 2017, 12:35
Number of books owned: 0
Country: Russia

Re: Scan Tailor Advanced

Post by 4lex4 » 21 Jan 2018, 18:57

Orpheus2017, I've just added the fix for MatrixCalc.h, clone STA, having switched to develop branch, and try to build that again.

Thank Tulon for assistance. I can support only Windows and Linux platforms and can't guarantee it will build on OS X. I've tested building STA with mingw-w64, gcc and VSC.

Orpheus2017
Posts: 2
Joined: 21 Jan 2018, 05:02
Number of books owned: 0
Country: United Kingdom

Re: Scan Tailor Advanced

Post by Orpheus2017 » 23 Jan 2018, 03:32

4lex and Tulon,

Many thanks for your assistance, hopefully together we can get ScanTailor advanced to build on OSX, it would be very valuable.

Unfortunately develop throws up an error earlier on in the compile chain - here it is:

Code: Select all

In file included from /Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:19:
In file included from /Users/siavush/Downloads/scantailor-advanced-develop/./filters/output/TabbedImageView.h:23:
In file included from /opt/local/libexec/qt5/lib/QtWidgets.framework/Headers/QWidget:1:
In file included from /opt/local/libexec/qt5/lib/QtWidgets.framework/Headers/qwidget.h:43:
In file included from /opt/local/libexec/qt5/lib/QtWidgets.framework/Headers/qtwidgetsglobal.h:43:
In file included from /opt/local/libexec/qt5/lib/QtGui.framework/Headers/qtguiglobal.h:43:
In file included from /opt/local/libexec/qt5/lib/QtCore.framework/Headers/qglobal.h:45:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:1464:38: error: 
      implicit instantiation of undefined template 'std::__1::hash<output::ImageViewTab>'
    : public integral_constant<bool, __is_empty(_Tp)> {};
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:383:18: note: in
      instantiation of template class 'std::__1::is_empty<std::__1::hash<output::ImageViewTab> >' requested here
          bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:765:13: note: in
      instantiation of default argument for '__unordered_map_hasher<output::ImageViewTab,
      std::__1::__hash_value_type<output::ImageViewTab, QRectF>, std::__1::hash<output::ImageViewTab> >' required here
    typedef __unordered_map_hasher<key_type, __value_type, hasher>   __hasher;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:79:31: note: in instantiation of template
      class 'std::__1::unordered_map<output::ImageViewTab, QRectF, std::__1::hash<output::ImageViewTab>,
      std::__1::equal_to<output::ImageViewTab>, std::__1::allocator<std::__1::pair<const output::ImageViewTab, QRectF> > >'
      requested here
        if (m_tabImageRectMap == nullptr) {
                              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:397:50: note: 
      template is declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
                                                 ^
/Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:158:30: warning: using the result of an
      assignment as a condition without parentheses [-Wparentheses]
                if (resource = findImageViewBase(dynamic_cast<QWidget*>(child))) {
                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:158:30: note: place parentheses around the
      assignment to silence this warning
                if (resource = findImageViewBase(dynamic_cast<QWidget*>(child))) {
                             ^
                    (                                                          )
/Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:158:30: note: use '==' to turn this
      assignment into an equality comparison
                if (resource = findImageViewBase(dynamic_cast<QWidget*>(child))) {
                             ^
                             ==
In file included from /Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:19:
In file included from /Users/siavush/Downloads/scantailor-advanced-develop/./filters/output/TabbedImageView.h:26:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:369:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:2203:21: error: 
      called object type 'hasher' (aka 'int') is not a function or function pointer
    size_t __hash = hash_function()(__k);
                    ^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:2432:35: note: in
      instantiation of function template specialization 'std::__1::__hash_table<std::__1::__hash_value_type<output::ImageViewTab,
      QRectF>, int, std::__1::__unordered_map_equal<output::ImageViewTab, std::__1::__hash_value_type<output::ImageViewTab, QRectF>,
      std::__1::equal_to<output::ImageViewTab>, true>, std::__1::allocator<std::__1::__hash_value_type<output::ImageViewTab, QRectF>
      > >::find<output::ImageViewTab>' requested here
    return static_cast<size_type>(find(__k) != end());
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:1116:65: note: in
      instantiation of function template specialization 'std::__1::__hash_table<std::__1::__hash_value_type<output::ImageViewTab,
      QRectF>, int, std::__1::__unordered_map_equal<output::ImageViewTab, std::__1::__hash_value_type<output::ImageViewTab, QRectF>,
      std::__1::equal_to<output::ImageViewTab>, true>, std::__1::allocator<std::__1::__hash_value_type<output::ImageViewTab, QRectF>
      > >::__count_unique<output::ImageViewTab>' requested here
    size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
                                                                ^
/Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:89:33: note: in instantiation of member
      function 'std::__1::unordered_map<output::ImageViewTab, QRectF, std::__1::hash<output::ImageViewTab>,
      std::__1::equal_to<output::ImageViewTab>, std::__1::allocator<std::__1::pair<const output::ImageViewTab, QRectF> > >::count'
      requested here
        if ((m_tabImageRectMap->count(old_view_tab) == 0) || (m_tabImageRectMap->count(new_view_tab) == 0)) {
                                ^
In file included from /Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:19:
In file included from /Users/siavush/Downloads/scantailor-advanced-develop/./filters/output/TabbedImageView.h:26:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:369:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__hash_table:2172:21: error: 
      called object type 'hasher' (aka 'int') is not a function or function pointer
    size_t __hash = hash_function()(__k);
                    ^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:1112:69: note: in
      instantiation of function template specialization 'std::__1::__hash_table<std::__1::__hash_value_type<output::ImageViewTab,
      QRectF>, int, std::__1::__unordered_map_equal<output::ImageViewTab, std::__1::__hash_value_type<output::ImageViewTab, QRectF>,
      std::__1::equal_to<output::ImageViewTab>, true>, std::__1::allocator<std::__1::__hash_value_type<output::ImageViewTab, QRectF>
      > >::find<output::ImageViewTab>' requested here
    iterator       find(const key_type& __k)       {return __table_.find(__k);}
                                                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:1456:20: note: in
      instantiation of member function 'std::__1::unordered_map<output::ImageViewTab, QRectF, std::__1::hash<output::ImageViewTab>,
      std::__1::equal_to<output::ImageViewTab>, std::__1::allocator<std::__1::pair<const output::ImageViewTab, QRectF> > >::find'
      requested here
    iterator __i = find(__k);
                   ^
/Users/siavush/Downloads/scantailor-advanced-develop/filters/output/TabbedImageView.cpp:92:58: note: in instantiation of member
      function 'std::__1::unordered_map<output::ImageViewTab, QRectF, std::__1::hash<output::ImageViewTab>,
      std::__1::equal_to<output::ImageViewTab>, std::__1::allocator<std::__1::pair<const output::ImageViewTab, QRectF> > >::at'
      requested here
        QRectF const& old_view_rect = m_tabImageRectMap->at(old_view_tab);
                                                         ^
1 warning and 3 errors generated.
make[2]: *** [filters/output/CMakeFiles/output.dir/TabbedImageView.cpp.o] Error 1
make[1]: *** [filters/output/CMakeFiles/output.dir/all] Error 2
make: *** [all] Error 2
This is with the same CMakefiles.txt configuration as master. Any suggestions on how to rectify this?

Many thanks

4lex4
Posts: 29
Joined: 15 Oct 2017, 12:35
Number of books owned: 0
Country: Russia

Re: Scan Tailor Advanced

Post by 4lex4 » 23 Jan 2018, 04:38

Orpheus2017, point here what versions of the libraries and tool-chains (cmake, compiler name and version) you use. Also point the cmake configuration and all the changes you've made to any scantailor source files (including CMakeLists.txt).

Update:
Orpheus2017, I've added the fix, clone the develop branch again.

4lex4
Posts: 29
Joined: 15 Oct 2017, 12:35
Number of books owned: 0
Country: Russia

Re: Scan Tailor Advanced

Post by 4lex4 » 07 Feb 2018, 07:53

ScanTailor Advanced v1.0.9 has been released: https://github.com/4lex4/scantailor-advanced/releases

I strongly recommend you to read the description of the new features by going through the links in the changelog. There are new key combinations description there.

Post Reply