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

cvtColor error #128

Closed
bertsky opened this issue May 27, 2024 · 4 comments
Closed

cvtColor error #128

bertsky opened this issue May 27, 2024 · 4 comments

Comments

@bertsky
Copy link
Contributor

bertsky commented May 27, 2024

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...

@vahidrezanezhad
Copy link
Member

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

@bertsky
Copy link
Contributor Author

bertsky commented May 28, 2024

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?

@vahidrezanezhad
Copy link
Member

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.

@bertsky
Copy link
Contributor Author

bertsky commented May 29, 2024

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

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

@bertsky bertsky closed this as completed May 29, 2024
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