qurator-spk/eynollah

cvtColor error

Closed this issue · 4 comments

In #108 we recently (probably because of a new OpenCV release) started to see this error:

INFO eynollah - INPUT FILE df_ld_0022741 (11/12) 
OpenCV(4.8.0) :-1: error: (-5:Bad argument) in function 'cvtColor'
> Overload resolution failed:
>  - src is not a numpy array, neither a scalar
>  - Expected Ptr<cv::UMat> for argument 'src'

INFO eynollah - Resizing and enhancing image...

I checked all places where cv2.cvtColor is used, and AFAICS it always gets passed a Numpy array. Unfortunately, OpenCV does not show the exact stack trace...

@bertsky
Could you please share the input file? And does this happen in the OCR-D pipeline or in the standalone Eynollah?

Oops, sry, my local branch already had a few more commits I forgot about, which exposed a problem with check_dpi.

See 60cf0bd

(IOW the type checking for PIL.Image was wrong, which had the conditional enter the branch expecting an array)

Would you like me to make a cherry-picked PR for this fix?

Oops, sry, my local branch already had a few more commits I forgot about, which exposed a problem with check_dpi.

See 60cf0bd

(IOW the type checking for PIL.Image was wrong, which had the conditional enter the branch expecting an array)

Would you like me to make a cherry-picked PR for this fix?

Yes, sure.

Oh, wow! I just realised that I had already fixed this in 867a726.

But somehow, I seemed to have forgot including #109 in #108.