项目作者: ytsutano

项目描述 :
Automatic de-keystoning for single camera DIY book scanners
高级语言: C++
项目地址: git://github.com/ytsutano/bookscan.git
创建时间: 2012-10-22T11:32:22Z
项目社区:https://github.com/ytsutano/bookscan

开源协议:ISC License

下载


bookscan

Single camera solution for book scanner.

WARNING: EXPERIMENTAL PROJECT

This program was written in ad-hoc manner without thinking about
publishing the source code. It was just a test of concept.

I’ve got many requests to publish the program after I posted YouTube videos:

So I published it. But it was a project that was done in a day years ago, and
I have no time to verify it still works today.

Compilation

Install OpenCV and SCons:

  1. sudo port install opencv scons

Compile using SCons:

  1. scons

Usage

The program takes three arguments:

  1. ./extpage test_input.jpg output_left.jpg output_right.jpg

where test_input.jpg is the input file name, and the following two are the
output file names.

Debugging using Webcam

To debug using an webcam, execute the program without an argument:

  1. ./extpage

Using Automator.app

One way to automate is to use Automator script like this one:

  1. if [ x$1 = x ]; then
  2. exit;
  3. fi
  4. FILENAME=${1##*/}
  5. EXT=${FILENAME##*.}
  6. BASE=${FILENAME%.*}
  7. SRC_PATH=${1%/*}
  8. RESULT_PATH=${SRC_PATH%/*}/out/
  9. LEFT_IMG=${RESULT_PATH}${BASE}_left.${EXT}
  10. RIGHT_IMG=${RESULT_PATH}${BASE}_right.${EXT}
  11. say "Extracting pages..."
  12. if extpage $1 $LEFT_IMG $RIGHT_IMG > /dev/null; then
  13. say "Done."
  14. else
  15. say "Failed."
  16. fi
  17. echo $1
  18. echo $LEFT_IMG
  19. echo $RIGHT_IMG

See automator.png.

Save it as an application and invoke it using Folder Actions.

Contributor

Yutaka Tsutano