DDMAL / DDMAL/document-preprocessing-toolkit

branch: iss1 RuntimeError: Image view dimensions out of range for data

オープン
#1 コメント 4 件 リアクション 0 件 担当者 1 名 @mondaugen が担当を希望しています GitHub で見る
主要言語
C++
スター
4
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

説明

here is my program:

```
import sys
import string

from gamera.core import *
from gamera.toolkits import staffline_removal
from gamera.toolkits import lyric_extraction

init_gamera()

def print_image_data(self):
print "stride", self.data.stride
print "ncols", self.data.ncols
print "nrows", self.data.nrows
# print "dim", self.data.dim
print "page_offset_x", self.data.page_offset_x
print "page_offset_y", self.data.page_offset_y
# print "offset", self.data.offset
print "size", self.data.size

# Load image from command line
image = load_image(sys.argv[1])

print "image data after load"
print type(image)
print_image_data(image)

# Binarize image
onebit = image.djvu_threshold()

print "image data after binarization"
print type(onebit)
print_image_data(onebit)

# get an estimation of staff height
sh = onebit.staffheight_estimation()
# staffspace
ss = onebit.staffspace_estimation()
# do lyric line detection
llmask = onebit.baseline_detection(ss) #<--- the problem happens here
print 'Staff-height estimation', sh,'Staff-space estimation', ss

# outputfile path
if '.' in sys.argv[1]:
fpath = string.join(sys.argv[1].split('.')[0:-1],'.')+"_llmask.png"
else:
fpath = sys.argv[1]+"_llmask.png"

llmask.save_PNG(fpath)
```
#### end program

here is the output of the program

```
image data after load

stride 2712
ncols 2712
nrows 3368
page_offset_x 0
page_offset_y 0
size 9134016
image data after binarization

stride 2712
ncols 2712
nrows 3368
page_offset_x 0
page_offset_y 0
size 9134016
staffspace:36, staffheight:4
staffspace:36, staffheight:4
Traceback (most recent call last):
File "./lyric-baseline-study.py", line 40, in
llmask = onebit.baseline_detection(ss)
File "/Users/nickesterer/Documents/development/gamera_env/lib/python2.7/site-packages/gamera/toolkits/lyric_extraction/plugins/lyricline.py", line 93, in __call__
valid_angle_degree, scalar_valid_height, valid_min_group)
RuntimeError: Image view dimensions out of range for data
nrows 27
offset_y 3342
data nrows 3368
data offset_y 0
ncols 37
offset_x 66
data ncols 2712
data offset_x 0
```

This was happening before installing the most recent commit to DDMAL/document-preprocessing-toolkit, but only on some images and not on others. Now using the same images as before, it happens on all images.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。