Closed akshitagupta15june closed 3 years ago
I want to work on this issue under gssoc'21.
Ok assigning you
I am getting an error on following code:-
gray=cv2.cvtcolor(img,cv2.COLOR BGR2GRAY)
error
Traceback (most recent call last) error: OpenCV(3.4.2) c: \miniconda3\conda-bld\opencv- suite 1533649848492\work\modules\imgproc\src\color.hpp:253: error: (-215:As sertion failed) vscn::contains(scn) && VDCN::contains(dcn) && VDepth : contains(depth) in function "cu::cvtHelperestruct ev::Set <3,4,-1), struct cv::Set<1,-1,-1), struct ev:Set<0,2,5>,2::cvtHelper
How to resolve this?
it should be like this gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
Nothing happened, same error. ![Uploading IMG_20210305_181917.jpg…]()
have you added all modules which are required in this task.
I have imported cv2 module and I have checked I have opencv and opencv_contrib both. Do I have to add something else also?
you should add OpenCV-python
are you taking any reference from somewhere?
I saw a github issue same as mine but unable to figure it out how to solve. Can I share that github issue link?
yes please share
yes so have you given the correct image name? or have you tried this use x = np.asarray(x, dtype=np.uint8) before do the conversion
Yes image name is correct but didn't tried this solution. Let me do this and then I will come back to you.
Nothing happened and my img is already in uint8... this didn't helped me and according to that github issue it said that all the img array values should be between 0-1 range and I have all 0-255 range. So that might be creating the problem and if so then I am unable to figure out how to do that.
So for converting the range from 0-255 to 0-1, I divided the array with 255 but still no improvement.
can you send me full code what you are writing
import cv2 import matplotlib.pyplot as plt import numpy as np
img=cv2.imread('G:/butterfly.jpg',0) surf=cv2.xfeatures2d.SURF_create() gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
I wrote the codes in wrong order that's why values were changing and cvtColor() was not taking the values correctly and hence the error. Correction:- np.uint8 line should come after imread () and then cvtColor() line. Now it is working. Thank you.
Great you debugged it yourself well done!
Thank you😊 and do I have only 1 week to submit the PR??
Hello, I am a GSSOC'21 participant and would like to contribute to this project.
I have created the surf project but I am not getting the desired result. What should I do? @akshitagupta15june
SURF is another robust algortihm used for robust classification of 3d constructions.
We should try out this algorithm as well for recognising facial expressions
Reference : https://people.ee.ethz.ch/~timofter/publications/Knopp-ECCV-2010.pdf