Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eynollah: contour data type = 17 is not supported #368

Closed
jbarth-ubhd opened this issue Jun 14, 2023 · 4 comments
Closed

eynollah: contour data type = 17 is not supported #368

jbarth-ubhd opened this issue Jun 14, 2023 · 4 comments

Comments

@jbarth-ubhd
Copy link

Using ocrd.sif built from ocrd/all:maximum at 2023-06-13 18:00 CEST

Tried with the image here:

https://digi.ub.uni-heidelberg.de/diglitData/v/duerer1527_-_aa2.tgz

... and essential the same workflow as in run.sh. See complete workflow at bottom.

13:07:36.601 ERROR ocrd.processor.helpers.run_processor - Failure in processor 'ocrd-eynollah-segment'                                    
Traceback (most recent call last):                                                                                                        
  File "/build/core/ocrd/ocrd/processor/helpers.py", line 128, in run_processor                                                           
    processor.process()                                                                                                                   
  File "/usr/local/lib/python3.8/site-packages/qurator/eynollah/processor.py", line 59, in process                                        
    Eynollah(**eynollah_kwargs).run()                                                                                                     
  File "/usr/local/lib/python3.8/site-packages/qurator/eynollah/eynollah.py", line 2276, in run                                           
    cx_bigest, cy_biggest, _, _, _, _, _ = find_new_features_of_contours(contours_only_text_parent)                                       
  File "/usr/local/lib/python3.8/site-packages/qurator/eynollah/utils/contour.py", line 80, in find_new_features_of_contours
    areas_main = np.array([cv2.contourArea(contours_main[j]) for j in range(len(contours_main))])
  File "/usr/local/lib/python3.8/site-packages/qurator/eynollah/utils/contour.py", line 80, in <listcomp>
    areas_main = np.array([cv2.contourArea(contours_main[j]) for j in range(len(contours_main))])
cv2.error: OpenCV(4.7.0) :-1: error: (-5:Bad argument) in function 'contourArea'
> Overload resolution failed:
>  - contour data type = 17 is not supported
>  - Expected Ptr<cv::UMat> for argument 'contour'

Workflow en detail:

ocrd workspace init
ocrd workspace add -g P_00001 -G OCR-D-IMG -i OCR-D-IMG_00001 -m image/tiff OCR-D-IMG/00001.tif

ocrd-olena-binarize -P impl wolf -P k 0.10 -I OCR-D-IMG -O OCR-D-001
ocrd-tesserocr-crop -I OCR-D-001 -O OCR-D-002
ocrd-olena-binarize -P impl wolf -P k 0.10 -I OCR-D-002 -O OCR-D-003
ocrd-tesserocr-deskew -P operation_level page -I OCR-D-003 -O OCR-D-004
ocrd-eynollah-segment -P models default -I OCR-D-004 -O OCR-D-005
ocrd-tesserocr-recognize -P model frak2021 -I OCR-D-005 -O OCR-D-OCR
@bertsky
Copy link
Collaborator

bertsky commented Jun 14, 2023

Not sure if this is related to qurator-spk/eynollah#106.

For OCR-D, please downgrade to qurator-spk/eynollah#108 – or use the current version of ocrd_all, just released today.

If the problem persists, please report with a test data (input image) directly to eynollah repository.

@jbarth-ubhd
Copy link
Author

Updated ocrd.sif today 14:12 CEST

approx. the same error:

15:05:05.439 ERROR ocrd.processor.helpers.run_processor - Failure in processor 'ocrd-eynollah-segment'
Traceback (most recent call last):
  File "/build/core/ocrd/ocrd/processor/helpers.py", line 128, in run_processor
    processor.process()
  File "/build/eynollah/qurator/eynollah/processor.py", line 59, in process
    Eynollah(**eynollah_kwargs).run()
  File "/build/eynollah/qurator/eynollah/eynollah.py", line 2277, in run
    cx_bigest, cy_biggest, _, _, _, _, _ = find_new_features_of_contours(contours_only_text_parent)
  File "/build/eynollah/qurator/eynollah/utils/contour.py", line 80, in find_new_features_of_contours
    areas_main = np.array([cv2.contourArea(contours_main[j]) for j in range(len(contours_main))])
  File "/build/eynollah/qurator/eynollah/utils/contour.py", line 80, in <listcomp>
    areas_main = np.array([cv2.contourArea(contours_main[j]) for j in range(len(contours_main))])
TypeError: Expected Ptr<cv::UMat> for argument 'contour'

@jbarth-ubhd
Copy link
Author

jbarth-ubhd commented Jun 14, 2023

Reported it to eynollah: qurator-spk/eynollah#110

@bertsky
Copy link
Collaborator

bertsky commented Jun 14, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants