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

error in cvtColor() call #5

Open
mjcastillo opened this issue Aug 27, 2021 · 3 comments
Open

error in cvtColor() call #5

mjcastillo opened this issue Aug 27, 2021 · 3 comments

Comments

@mjcastillo
Copy link

I am getting an error running this locally with an image that work when I run it on the hosted live version, so pretty sure the image is good, Here is the error. Any ideas on why this assertion is failing? Something likely wrong in my environment (windows 10, python3)?

Traceback (most recent call last):
File "C:\Users\Mikej\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts\rastercarve-script.py", line 33, in
sys.exit(load_entry_point('rastercarve==1.0.8', 'console_scripts', 'rastercarve')())
File "C:\Users\Mikej\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\rastercarve_main_.py", line 458, in main
doEngrave()
File "C:\Users\Mikej\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\rastercarve_main_.py", line 315, in doEngrave
img = ~cv2.cvtColor(cv2.imread(glob_args.filename), cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.3) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-q3d_8t8e\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

PS C:\Users\Mikej\Downloads\rastercarve-master\rastercarve-master> rastercarve --width 5 -d .05 -s 100 --metric --no-line-numbers examples/105-0521_IMG.JPG > out.nc
Traceback (most recent call last):
File "C:\Users\Mikej\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts\rastercarve-script.py", line 33, in
sys.exit(load_entry_point('rastercarve==1.0.8', 'console_scripts', 'rastercarve')())
File "C:\Users\Mikej\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\rastercarve_main_.py", line 458, in main
doEngrave()
File "C:\Users\Mikej\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\rastercarve_main_.py", line 315, in doEngrave
img = ~cv2.cvtColor(cv2.imread(glob_args.filename), cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.3) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-q3d_8t8e\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

@mjcastillo
Copy link
Author

something with the image because it works for many other images I have. The weird thing is the hosted version (live) of rastercarve handle the print just fine. Maybe a different version on the hosted site? Any ideas on how to work around this (e.g. try and older version of the code)?
Thanks

@built1n
Copy link
Owner

built1n commented Aug 30, 2021

Hi,

Thanks for reporting this issue. I'm guessing the cause is a failed call to opencv's imread(), probably because something is weird about your image. Could you post the image here so we can investigate further?

The hosted site is running in a Docker container with opencv-python 4.2.0.32 on Debian Buster, if that's of any help to you.

@mjcastillo
Copy link
Author

mjcastillo commented Aug 30, 2021 via email

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