ebook distortion
Re: ebook distortion
Ops, my mistake, actual situation is this:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: ebook distortion
If this is an ebook page (presumably digital), why are the pages bulging outside the e-book bounds? If the pages were not outside the bounds then a perspective on each side should do the trick. If there is some digital distortion to curl the pages then you have a tough problem and perhaps higher order polynomial may be the only solution.
Re: ebook distortion
It is NOT an ebook! It's a paper book, and I'm trying to digitize it to turn it into an ebook!
Re: ebook distortion
Out of curiosity I tried to remove the distortion using Hugin as per the tutorial
http://hugin.sourceforge.net/tutorials/ ... e/en.shtml
Somewhat successful. It might have been better if I'd had the page edges to use for control points.
Probably useless for batch processing if you're trying to process a whole book.
Why not scan and OCR it?
I think Sirius Cybernetics Corporation might have a suitable product.
Cheers,
Peter
http://hugin.sourceforge.net/tutorials/ ... e/en.shtml
Somewhat successful. It might have been better if I'd had the page edges to use for control points.
Probably useless for batch processing if you're trying to process a whole book.
Why not scan and OCR it?
I think Sirius Cybernetics Corporation might have a suitable product.
Cheers,
Peter
Re: ebook distortion
I'm sorry but you got a very poor result! Characters are even more distorted! (some ones are bigger than others)geep999 wrote:Out of curiosity I tried to remove the distortion using Hugin as per the tutorial
http://hugin.sourceforge.net/tutorials/ ... e/en.shtml
All pages would have same distortion, so once I find the algorithm for first pages, it will be ok for all of them.Somewhat successful. It might have been better if I'd had the page edges to use for control points.
Probably useless for batch processing if you're trying to process a whole book.
I don't unsrestand the question: this is what I am trying to do! I am "scanning" a book with a camera, and I'd like to distort the resulting images to get then processable by an OCR.Why not scan and OCR it?
Re: ebook distortion
Gwenview (Linux viewer) displayed a thumbnail image of your book in which I saw it being held between two hands standing on a table. I was thinking that it would be difficult to make that accurately repeatable.All pages would have same distortion, so once I find the algorithm for first pages, it will be ok for all of them.
Sorry - I meant scan with a real scanner, not a camera. But if you've no scanner then you're stuck with the camera.I don't unsrestand the question: this is what I am trying to do! I am "scanning" a book with a camera, and I'd like to distort the resulting images to get then processable by an OCR.Why not scan and OCR it?
Even with a scanner you run into problems with distortion at the middle of the book.
Good luck,
Peter
Re: ebook distortion
Putting some markers on the table, I was able to shoot 10 pictures with identical shape of the pages.geep999 wrote:Gwenview (Linux viewer) displayed a thumbnail image of your book in which I saw it being held between two hands standing on a table. I was thinking that it would be difficult to make that accurately repeatable.All pages would have same distortion, so once I find the algorithm for first pages, it will be ok for all of them.
I also have a flatbed scanner, but don't want to use it, for two reasons:geep999 wrote:Sorry - I meant scan with a real scanner, not a camera. But if you've no scanner then you're stuck with the camera.I don't unsrestand the question: this is what I am trying to do! I am "scanning" a book with a camera, and I'd like to distort the resulting images to get then processable by an OCR.Why not scan and OCR it?
- fully opening a book a couple of hundreds of times can damage it
- I'd like to make a"DIY bookscanner" affordable for every owner of just a cellphone. My one has 5 MP camera, but I think 3 or even 2 would be enough.
edit:
3rd reason: my phone can take automagically thousands of picture at 10 seconds delay. I think all nokia phones can do it.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: ebook distortion
Okay so it looks like you are stuck with a very freeform polynomial.
So get a book containg a large grid pattern. Locate all the gird pixels (morphology can help with that. and figure out where you want each of those points to end up in the final image. Store that in a file...
sx1 sy1 dx1 dy1
...
for source x,y to destination x,y
now add one more line at the top (the polynomial order) to fit to that data. make it at least 2 may be 3. And use it.
Do it with the grid photo image first
convert input_grid.png -distort polynomial '@grid_data.txt' result.png
Give us links to your grid image and data would also be good.
once you have it for the grid, you can repeat it for all your other pages.
So get a book containg a large grid pattern. Locate all the gird pixels (morphology can help with that. and figure out where you want each of those points to end up in the final image. Store that in a file...
sx1 sy1 dx1 dy1
...
for source x,y to destination x,y
now add one more line at the top (the polynomial order) to fit to that data. make it at least 2 may be 3. And use it.
Do it with the grid photo image first
convert input_grid.png -distort polynomial '@grid_data.txt' result.png
Give us links to your grid image and data would also be good.
once you have it for the grid, you can repeat it for all your other pages.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: ebook distortion
I don't understand this part.anthony wrote: now add one more line at the top (the polynomial order) to fit to that data. make it at least 2 may be 3. And use it.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: ebook distortion
The one number on the first to specify the 'order' for the polynomial
Eg:
3
10,10 0,0
10,5 0,10
and so on
Eg:
3
10,10 0,0
10,5 0,10
and so on
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: ebook distortion
I guess you mean "add a '3' as first line". I didn't get why you were talking about one line while meaning one number (as I'm specifying all parameters on a single line).anthony wrote:The one number on the first to specify the 'order' for the polynomial
Eg:
3
10,10 0,0
10,5 0,10
and so on
But I already did it, with weird results; that's why I was asking at the beginning if I have to specify points in a specific oder (clockwise, ccw, line by line... ?).
I thought just specifying points for the "contour" of the text area was enough. Specifying 3-4 points per each text line is not a good option, I think.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: ebook distortion
The order of control points is not important.
However do not just select points along the curve. It will fail.
You need to specify pixels all over the image. including all corners, edges, and middle.
Polynomial requires lots of points. The more the better, the more uniform the better.
perhaps you can give use the list of points?
However do not just select points along the curve. It will fail.
You need to specify pixels all over the image. including all corners, edges, and middle.
Polynomial requires lots of points. The more the better, the more uniform the better.
perhaps you can give use the list of points?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: ebook distortion
Like describing a surface rather than a line?anthony wrote: Polynomial requires lots of points. The more the better, the more uniform the better.
Thanks, I'll try.