#๐ Opencv is having an error every time I run
38 messages ยท Page 1 of 1 (latest)
@rain sky
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
I didn't realise it didnt like me adding python files
and this is the error^^^
line 98 if that helps
there's nothing there
That's a function definition, I thought you pointed to the line where it errors
Anyway, your error says "Invalid number of channels in input image [...] where [...] is 1" So I'm guessing you gave a grayscale image to something that expects three channels
Line 130 is processed_images = preprocess_images(images), so it's inside the function you showed earlier
Find the line within that function that raises an error
oh, you have image and images, ok
yeah
ok, so what line within that function errors?
74
(my guess is that img is already gray)
I was just about to say
ok, so now you go to line 74 and check the shape of img to confirm
And if that's the case, you should:
- Decide if it's acceptable that one of the images is already gray, and if so handle it.
- Or, if it shouldn't be gray, find out why it is
I dont think I really need that function
as I want to let the image be as big as it wants
instead of resizing it to 256 pixels
You also normalize the values in the image. You don't need that either?
There's also a thresholding there
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.