Ask Your Question

Samjith888's profile - activity

2020-11-15 14:51:24 -0600 received badge  Notable Question (source)
2020-11-02 16:20:25 -0600 received badge  Notable Question (source)
2020-09-01 23:28:09 -0600 received badge  Famous Question (source)
2020-07-03 09:39:11 -0600 marked best answer opencv error: assertion failed (samples.cols == var_count && samples.type() == 5) in cv::ml:: etc.

I created a xml file by using svm . In my test program i have loaded that xml file and i use svm predict, but it showing the error. how can i correct this ?

int main(){
HOGDescriptor hog;
vector<float> featureVector;
Ptr<ml::SVM> svm = ml::SVM::create();

Mat testdata, feature;


Mat img = imread("C:/Users/Sam/Desktop/Test/1.jpg");


    hog.compute(img, featureVector, Size(32, 32), Size(0, 0));


    feature = Mat(featureVector).reshape(1, 1);
    testdata.push_back(feature);


    svm->load("Features.xml");

    svm->predict(testdata);

}

2020-07-03 09:18:35 -0600 received badge  Popular Question (source)
2020-06-10 22:05:38 -0600 received badge  Popular Question (source)
2020-04-25 16:02:46 -0600 received badge  Popular Question (source)
2019-11-23 12:03:40 -0600 received badge  Notable Question (source)
2019-09-21 01:09:43 -0600 commented answer got error while converting HSV2BGR

Yes.. n1 image is grayscale.

2019-09-21 01:09:13 -0600 marked best answer got error while converting HSV2BGR

Below is the code i wrote.

> import cv2 
> import numpy as np
> image = cv2.imread('67.png')
> cv2.imshow('original', image) hsv =
> cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
> hsv=  hsv[:, :, 1] n1=
> np.where(np.logical_and(80<=hsv,
> hsv<=180), 255, hsv) res =
> cv2.cvtColor(n1, cv2.COLOR_HSV2BGR)
> cv2.imshow('result', res)
> cv2.waitKey(0)

Got following error

cv2.error: OpenCV(4.1.0) c:\projects\opencv-python\opencv\modules\imgproc\src\color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function '__cdecl cv::impl::anonymous-namespace'::CvtHelper<struct cv::impl::anonymous namespace'::Set<3,-1,-1>,struct cv::impl::A0x3b52564f::Set<3,4,-1>,struct cv::impl::A0x3b52564f::Set<0,5,-1>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)'

Invalid number of channels in input image: 'VScn::contains(scn)' where 'scn' is 1

I have found the issue can be solve by using img = np.array(img, dtype=np.uint8) . But its not working. Any help will be appreciated

2019-09-21 01:09:12 -0600 received badge  Critic (source)
2019-09-20 14:13:41 -0600 commented answer got error while converting HSV2BGR

No.. Its a RGB image.. and then iI converted it into hsv. After some processing , again I’m trying to convert the hsv in

2019-09-20 13:36:32 -0600 edited question got error while converting HSV2BGR

got error while converting HSV2BGR Below is the code i wrote. > import cv2 > import numpy as np > image = cv2

2019-09-20 13:35:41 -0600 edited question got error while converting HSV2BGR

got error while converting HSV2BGR Below is the code i wrote. > import cv2 > import numpy as np > image = cv2

2019-09-20 13:32:50 -0600 asked a question got error while converting HSV2BGR

got error while converting HSV2BGR Below is the code i wrote. > import cv2 > import numpy as np > image = cv2

2019-09-17 13:11:17 -0600 received badge  Notable Question (source)
2019-09-17 13:11:17 -0600 received badge  Popular Question (source)
2019-08-16 07:31:31 -0600 received badge  Popular Question (source)
2019-03-19 07:42:42 -0600 asked a question Corrupt JPEG Data : 2 extraneous bytes before marker 0xd9

Corrupt JPEG Data : 2 extraneous bytes before marker 0xd9 I'm training sets of images using tensorflow , where i'm also

2019-02-12 22:50:35 -0600 asked a question which values have to be add into numpy.add_argument()?

which values have to be add into numpy.add_argument()? I got some code for human body detection using pedestrian detecti

2018-12-17 12:54:09 -0600 received badge  Famous Question (source)
2018-12-17 12:54:09 -0600 received badge  Popular Question (source)
2018-12-17 12:54:09 -0600 received badge  Notable Question (source)
2018-09-04 07:02:24 -0600 commented question How can i calculate Image quality by using BRISQUE in Opencv 3.4.1?

@ berak : Objective Blind or No-Reference IQA- this all i want to use . I have a image and i want want to get the qualit

2018-09-04 06:21:17 -0600 commented question How can i calculate Image quality by using BRISQUE in Opencv 3.4.1?

@ berak : Objective Blind or No-Reference IQA- this all i want to use . I have a image and i want want to get the qualit

2018-09-04 05:55:42 -0600 commented question How can i calculate Image quality by using BRISQUE in Opencv 3.4.1?

@berak: Can i proceed with above code by correcting errors(by using libsvm)?

2018-09-04 05:13:04 -0600 commented answer How can i calculate Image quality by using BRISQUE in Opencv 3.4.1?

@berak : Yes , its using IplImage and diffcult to understand .Can u suggest the steps or code for checking the quality o

2018-09-03 06:54:48 -0600 edited question How can i calculate Image quality by using BRISQUE in Opencv 3.4.1?

How can i calculate Image quality by using BRISQUE in Opencv 3.4.1? I have go through several tutorial about BRISQUE al

2018-09-03 06:54:04 -0600 edited question How can i calculate Image quality by using BRISQUE in Opencv 3.4.1?

How can i calculate Image quality by using BRISQUE in Opencv 3.4.1? I have go through several tutorial about BRISQUE al

2018-09-03 06:14:18 -0600 edited question How can i calculate Image quality by using BRISQUE in Opencv 3.4.1?

How can i calculate Image quality by using BRISQUE in Opencv 3.4.1? I have go through several tutorial about BRISQUE al

2018-09-03 06:13:19 -0600 asked a question How can i calculate Image quality by using BRISQUE in Opencv 3.4.1?

How can i calculate Image quality by using BRISQUE in Opencv 3.4.1? I have go through several tutorial about BRISQUE al

2018-09-03 05:58:33 -0600 commented question Error : assertion failed (depth ==5 || depth==6) in cv::pow,fill c:\opencv\...\mathfuncs.cpp

@berak: I can ,but i can't understand. Can u explain it by correcting the error?

2018-09-03 05:20:11 -0600 commented question Error : assertion failed (depth ==5 || depth==6) in cv::pow,fill c:\opencv\...\mathfuncs.cpp

@berak : how can i correct it ? and while debugging the errors shown in cv::pow(sigma, double(0.5), sigma); // sigma = s

2018-08-24 04:43:33 -0600 asked a question Error : assertion failed (depth ==5 || depth==6) in cv::pow,fill c:\opencv\...\mathfuncs.cpp

Error : assertion failed (depth ==5 || depth==6) in cv::pow,fill c:\opencv\...\mathfuncs.cpp Getting assertion failed e

2018-08-23 07:26:14 -0600 commented question Which Features extraction method will be more accurate for classifying the images based on their Clarity?

@berak : I have also used HOH with SVM to classify whether a image contains human or not .The images were captured from

2018-08-22 06:29:09 -0600 commented answer OpenCV HOG is not detecting people

@berak : The person.xml is not accessible now. Can you provide a new link please

2018-08-22 04:17:13 -0600 edited question Which Features extraction method will be more accurate for classifying the images based on their Clarity?

Which Features extraction method will be more accurate for classifying the images based on their Clarity? I want to clas

2018-08-22 04:03:48 -0600 commented question Which Features extraction method will be more accurate for classifying the images based on their Clarity?

@berak : Clarity check means that the image is classifying into good or bad based on their Clarity. Bad images will be b

2018-08-22 02:40:03 -0600 asked a question Which Features extraction method will be more accurate for classifying the images based on their Clarity?

Which Features extraction method will be more accurate for classifying the images based on their Clarity? I want to clas

2018-08-20 04:41:56 -0600 commented answer I read image file name using 'fs::directory_iterator' . How can i read this file by using imread in opencv c++

@berak : your code works. but we can also use 'namespace fs = std::experimental::filesystem;' this concept

2018-08-20 04:40:27 -0600 marked best answer I read image file name using 'fs::directory_iterator' . How can i read this file by using imread in opencv c++

I wrote the following code to read the files from a directory and ' fs::path(p.path()).filename()' this function returns the filename..How can i use the imread function after that?

    string path = "C:/Users/Sam/Images2/";
   for (const auto & p : fs::directory_iterator(path))
   {
       cout << fs::path(p.path()).filename() << " " << " Image " << endl;
      Mat img = imread((fs::path(p.path()).filename()), IMREAD_GRAYSCALE);
}
2018-08-20 02:46:55 -0600 commented question I read image file name using 'fs::directory_iterator' . How can i read this file by using imread in opencv c++

@sturkmen : i have done those steps. I can read the file name by using '(fs::path(p.path()).filename())' , but can't pas