application locks when calling statistical correction

Bug #331267 reported by Ian Sullivan
2
Affects Status Importance Assigned to Milestone
BookLiberator
Undecided
Unassigned

Bug Description

Whenever running against a full book's worth of images, bkrpr.py locks up when switching to the "Applying statistical correction to cropped images" step. The relevant terminal output from three occurrences follows:

======= Book 1:

Applying statistical correction to cropped images.
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/threading.py", line 446, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/ian/Desktop/bkrpr/ocr-tests/bkrpr/generator_task.py", line
25, in _start
    for ret in self.generator(*args, **kwargs):
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 873, in
do_sanity_check
    self._recrop_out_of_spec(f)
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 823, in
_recrop_out_of_spec
    self.left_mean, 'left', 5)
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 161, in
next_white_col
    if not self.white(self.im.getpixel((x,y)), **kwargs):
  File "/home/ian/Desktop/bkrpr/bkrpr/graphic.py", line 172, in getpixel
    return self.im.getpixel(*arg, **kwarg)
  File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 924, in
getpixel
    return self.im.getpixel(xy)
IndexError: image index out of range

======= Book 2:

Applying statistical correction to cropped images.
   Lowering the top.
Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/threading.py", line 446, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/ian/Desktop/bkrpr/ocr-tests/bkrpr/generator_task.py", line
25, in _start
    for ret in self.generator(*args, **kwargs):
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 873, in
do_sanity_check
    self._recrop_out_of_spec(f)
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 829, in
_recrop_out_of_spec
    self.M.crop.lines[f]['crop'][3])
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 115, in
lower_the_top
    t1 = self.next_white_row(left,top,right,bottom, 'down', 3)
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 69, in
next_white_row
    if not self.white(self.im.getpixel((x,t)), **kwargs):
  File "/home/ian/Desktop/bkrpr/bkrpr/graphic.py", line 172, in getpixel
    return self.im.getpixel(*arg, **kwarg)
  File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 924, in
getpixel
    return self.im.getpixel(xy)
IndexError: image index out of range

======= Book 3:

Applying statistical correction to cropped images.
   Lowering the top.
   Raising the bottom.
Adjusted /home/ian/Desktop/2-16-09/No Law/105b.crop.png
   Lowering the top.
   Raising the bottom.
Adjusted /home/ian/Desktop/2-16-09/No Law/106b.crop.png
   Lowering the top.
   Raising the bottom.
Adjusted /home/ian/Desktop/2-16-09/No Law/10b.crop.png
   Lowering the top.
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/threading.py", line 446, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/ian/Desktop/bkrpr/ocr-tests/bkrpr/generator_task.py", line
25, in _start
    for ret in self.generator(*args, **kwargs):
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 873, in
do_sanity_check
    self._recrop_out_of_spec(f)
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 829, in
_recrop_out_of_spec
    self.M.crop.lines[f]['crop'][3])
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 115, in
lower_the_top
    t1 = self.next_white_row(left,top,right,bottom, 'down', 3)
  File "/home/ian/Desktop/bkrpr/bkrpr/cropper.py", line 69, in
next_white_row
    if not self.white(self.im.getpixel((x,t)), **kwargs):
  File "/home/ian/Desktop/bkrpr/bkrpr/graphic.py", line 172, in getpixel
    return self.im.getpixel(*arg, **kwarg)
  File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 924, in
getpixel
    return self.im.getpixel(xy)
IndexError: image index out of range

Revision history for this message
James Vasile (james.vasile) wrote :

This bug has been fixed in the wx branch, which will be merged into trunk shortly.

Changed in bkrpr:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers