Hi list,

I've got a test document (a grayscale PNG) which has a white bg.
Trying to segment it using other methods beside RAST fails.

(1)  Error:
ocroscript: segmenter.lua:24: CHECK ./ocr-utils/ocr-utils.cc:833
background_seems_white(a)
stack traceback:
        [C]: in function 'segment'
        segmenter.lua:24: in main chunk
        [C]: ?


segmenter.lua:

 20 --segmenter = make_SegmentPageByRAST(); --works
 21 --segmenter = make_SegmentPageByXYCUTS(); --needs binary image. fail (2)
 22 --segmenter = make_SegmentPageBy1CP(); --fail (1)
 23 segmenter = make_SegmentPageByMorphTrivial(); --fail (1)
 24 segmenter:segment(seg,image); -- fails (1) & (2)
 25 check_page_segmentation(seg);

Lines from ocr-utils/ocr-utils.cc:
   831      void optional_check_background_is_lighter(colib::bytearray &a) {
   832          if(bgcheck) {
   833              CHECK_CONDITION(background_seems_white(a));
   834          }
   835      }

So, my question is why does it matter if the bg is white and why the
check in place?
I _could_ possibly set bgcheck = false, recompile and get away with
it. But I somewhat fail to understand what the motivation is. Could
someone please enlighten me before I step on a giant monster and get
killed?

(2) A binarize'd image was provided but then
"check_page_segmentation(seg)" crushed it right away:
ocroscript: segmenter.lua:39: CHECK
./ocr-utils/ocr-segmentations.cc:275 (column > 0 && column < 32) ||
column == 254 || column == 255
stack traceback:
        [C]: in function 'check_page_segmentation'
        segmenter.lua:39: in main chunk
        [C]: ?

The binarize'd image was provided using:
 28 input = bytearray();
 29 iulib.read_image_gray(input,arg[1]);
 30 binarizer:binarize(image,input);

Why?

Thanks loads.
-- 
Regards,
Ishwor Gurung

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ocropus" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ocropus?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to