Dekeystoning with a checkerboard

Share your process here - how to build something, scan something, or use something.

Re: Dekeystoning with a checkerboard

Postby jimboh » 10 Jan 2011, 00:19

What if your book has chessboard diagrams?
Keres - Road to the Top 64.tiff
User avatar
jimboh
 
Posts: 74
Joined: 06 Jan 2011, 00:55

Re: Dekeystoning with a checkerboard

Postby Shaknum » 10 Jan 2011, 01:28

jimboh wrote:What if your book has chessboard diagrams?

Good question. I just ran your image through the processor and while it detected a possible checkerboard candidate, it ultimately rejected it. Bad new is it takes forever (like 2 min.) to figure out that it is not a good checkerboard candidate. So this method will work for you, but it is something you would probably leave overnight.
Shaknum
 
Posts: 91
Joined: 16 Aug 2010, 13:10

Re: Dekeystoning with a checkerboard

Postby kasslloyd » 10 Jan 2011, 05:42

Wouldn't it be relatively easy to just remove the deciding factor out of the equation and put an optional command line option to specifically state which files are the checkerboard for dekeystoning that way it wouldn't need to decide on every picture and could run through the batch MUCH faster. This would be useful for peoples whos setups allow them to not have to reposition the cameras for the whole batch, so just one checkerboard should allow you to dekeystone every image instead of having to insert several in the middle of the book?

My C++ is very very rusty, don't think I could make that change myself... heh.
kasslloyd
 
Posts: 41
Joined: 19 Dec 2010, 21:25

Re: Dekeystoning with a checkerboard

Postby rob » 10 Jan 2011, 13:55

I think I'm definitely going to move to QR-Codes. They are those 2D barcodes, and even barcodes in books won't fool it, because we will also look for specific encoded information within the QR-Codes. I should have a prototype today.
The Singularity is Near. ~ http://halfbakedmaker.org ~ Follow me as I build the world's first all-mechanical steam-powered computer.
User avatar
rob
 
Posts: 770
Joined: 03 Jun 2009, 13:50
Location: Maryland, United States

Re: Dekeystoning with a checkerboard

Postby Gerard » 10 Jan 2011, 14:10

rob wrote:I think I'm definitely going to move to QR-Codes. They are those 2D barcodes, and even barcodes in books won't fool it, because we will also look for specific encoded information within the QR-Codes. I should have a prototype today.


besides the book about diybookscaning (with a chapter about your method) which will be written i the future :mrgreen:
User avatar
Gerard
 
Posts: 153
Joined: 17 Oct 2010, 07:15
Location: Berlin (Germany)

Re: Dekeystoning with a checkerboard

Postby rob » 10 Jan 2011, 22:57

rob wrote: I should have a prototype today.


...or maybe not. I got busy :/
The Singularity is Near. ~ http://halfbakedmaker.org ~ Follow me as I build the world's first all-mechanical steam-powered computer.
User avatar
rob
 
Posts: 770
Joined: 03 Jun 2009, 13:50
Location: Maryland, United States

Re: Dekeystoning with a checkerboard

Postby steve1066d » 10 Jan 2011, 23:30

What library are you going to use for your QR barcode version?
Steve Devore
BookScanWizard, a flexible book post-processor.
steve1066d
 
Posts: 236
Joined: 27 Nov 2010, 02:26
Location: Minneapolis, MN

Re: Dekeystoning with a checkerboard

Postby rob » 11 Jan 2011, 10:59

I'm using ZXing.
The Singularity is Near. ~ http://halfbakedmaker.org ~ Follow me as I build the world's first all-mechanical steam-powered computer.
User avatar
rob
 
Posts: 770
Joined: 03 Jun 2009, 13:50
Location: Maryland, United States

Re: Dekeystoning with a checkerboard

Postby rob » 11 Jan 2011, 16:34

OK, here is the latest dekeystoning program. At the bottom of the post is qrpc-1.0.zip. Unzip it, and follow the instructions in README.TXT, which are reproduced here.

Note that you will need Java version 6.

Instructions:

Print out the QR registration image.jpg file at 100%. The QR codes should be three inches (or about 76 mm) apart. Next, cut out, leaving about 1/2 inch (or about 20 mm) of space from the edges of the QR codes. Make sure you get the bottom edge straight. Finally, paste or tape the page to something reasonably flat. A pane of glass is ideal. Make sure the bottom edge of the page lines up with the bottom edge of your flat item.

Now, do it again for the other side of your platen. You should now have two registration plates.

Now, position your camera on your book, setting up the location, orientation, and zoom. Before you take first picture, place the registration plates on top of the platen, and look through the camera viewfinder to make sure all four QR codes are visible. Take an image.

Now remove the registration plates, and scan your book normally.

Whenever you change the position, orientation, or zoom of your camera, you will need to add the registration plates again before resuming scanning. Also, even if you did not change your camera setup, you might want to add the registration plates every 50 or 100 pages or so.

When you are done, place the left and right images in separate directories. Then point the QR Perspective Corrector at the left image directory, then at the right image directory:

Usage:

java -jar <directory where qrpc.jar is>/qrpc.jar <directory where source images are>

You should end up with files in the same directory where the source images are, except that the registration images are prepended with "qr " while the corrected images are prepended with "dekey ".

Now you should be able to run your images through Scan Tailor.

For support, ask for it in the Software section of the diybookscanner.org forums.
Attachments
qrpc-1.0.zip
(1.53 MiB) Downloaded 110 times
The Singularity is Near. ~ http://halfbakedmaker.org ~ Follow me as I build the world's first all-mechanical steam-powered computer.
User avatar
rob
 
Posts: 770
Joined: 03 Jun 2009, 13:50
Location: Maryland, United States

Re: Dekeystoning with a checkerboard

Postby Shaknum » 12 Jan 2011, 17:48

I get this error:
Code: Select all
2011-01-12 16:45:09,592 [INFO ] Dekeystoning image...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
   at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:59)
   at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:397)
   at java.awt.image.Raster.createWritableRaster(Raster.java:938)
   at java.awt.image.BufferedImage.getData(BufferedImage.java:1382)
   at qrpc.PerspectiveOp.filter(PerspectiveOp.java:102)
   at qrpc.Main.main(Main.java:233)
Shaknum
 
Posts: 91
Joined: 16 Aug 2010, 13:10

PreviousNext

Return to Tutorials/How-To's

Who is online

Users browsing this forum: No registered users and 1 guest