Hello,

I want to retrieve the values x0, y0, width and height for each row. How 
can I retrieve these values (file-ocropus gpageseg)?

I tried this:

In ocropus-gpageseg :

  for i,l in enumerate(lines):
        binline = psegutils.extract_masked(1-cleaned,l,pad=args.pad,expand=
args.expand)
        ocrolib.write_image_binary("%s_ligne%04d.png"%(outputdir,i+1),
binline)
        chaine = ocrolib.write_coord(segmentation,i+1)
        fichier = open("%s_ligne%04d.txt"%(outputdir,i+1), 'w')
        fichier.write(chaine)
        fichier.close()

And in common.py :

def write_coord(pseg,num):
    regions = ocrolib.RegionExtractor()
    regions.setPageLines(pseg)
    x0,y0,x1,y1 = (regions.x0(num),regions.y0(num),regions.x1(num),regions.
y1(num))
    height = y1 - y0
    width = x1 - x0
    chaine = str(x0) + " " + str(width) + " " + str(y0) + " " + str(height) 
    #chaine = "12 24 15 26"
    return chaine


But I have an error : AttributeError: RegionExtractor instance has no 
attribute 'comp'


How can I retrieve this coordinates?

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"ocropus" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/ocropus/-/KGClzxYHAcQJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to