Ask Your Question

LeBorzi's profile - activity

2018-12-14 06:20:02 -0600 edited question Converting from RGB to LAB yields strange results, but vice versa works fine

Converting from RGB to LAB yields strange results, but vice versa works fine I have a RGB image that I want to convert t

2018-12-14 06:12:20 -0600 asked a question Converting from RGB to LAB yields strange results, but vice versa works fine

Converting from RGB to LAB yields strange results, but vice versa works fine I have a LAB image that I want to convert t

2018-04-07 14:14:55 -0600 commented question Linear kernel only one that does not return poor classification

How come that it seems like switching kernels seems to break the classifier though? Surely, switching from linear to ano

2018-04-07 02:44:16 -0600 received badge  Editor (source)
2018-04-07 02:44:16 -0600 edited question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different SVM kernels in OpenCV, I realised

2018-04-06 15:33:35 -0600 commented question Linear kernel only one that does not return poor classification

Sorry, I did not realise it posted this many times...

2018-04-06 15:04:05 -0600 asked a question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different kernels in OpenCV, I realised tha

2018-04-06 15:04:05 -0600 asked a question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different kernels in OpenCV, I realised tha

2018-04-06 15:04:04 -0600 asked a question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different kernels in OpenCV, I realised tha

2018-04-06 15:04:04 -0600 asked a question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different kernels in OpenCV, I realised tha

2018-04-06 15:04:01 -0600 asked a question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different kernels in OpenCV, I realised tha

2018-04-06 15:04:01 -0600 asked a question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different kernels in OpenCV, I realised tha

2018-04-06 15:04:00 -0600 asked a question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different kernels in OpenCV, I realised tha

2018-04-06 15:03:59 -0600 asked a question Linear kernel only one that does not return poor classification

Linear kernel only one that does not return poor classification After trying different kernels in OpenCV, I realised tha

2018-04-04 09:23:41 -0600 commented answer How to predict HOG features each frame with trained SVM classifier (and possibly get the accuracy of the prediction)

Finally, I would like to add that I was able to get everything working, due to your guidance I also got a nice confusion

2018-04-04 06:23:20 -0600 marked best answer How to predict HOG features each frame with trained SVM classifier (and possibly get the accuracy of the prediction)

I created and trained an SVM emotion classifier using a set of 700 image samples and after applying some testing, it scored very well. My problem is that when I use the svm.predict function that I used to score the classifier on the current frame (after I extracted the HOG features), I get the error "samples.cols == var_count && samples.type() == 5 in function predict". I made sure my extracted features are float32 numpy arrays. If someone could help me find out why this is happening and how to solve it, I would really appreciate it! Thank you in advance.

# Create video capture object
    video_capture = cv2.VideoCapture(0);
    # Start creating loop, using webcam image every frame
    while True:
        # read method returns two elements, the last being the last frame captured by the camera - the _ allows us to ignore the first element
        _, frame = video_capture.read();
        # convert the camera frame into a grayscale version
        grayscale_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
        # Create dependancies for live detection
        aoi = grayscale_frame;
        aoi = pre_process_img(aoi);
        # Extract feature
        current_frame_features = hog.compute(aoi, (64, 64));
        # Convert features to numpay array
        current_frame_features = np.array(current_frame_features, dtype = np.float32);
        # Use classifier to make a prediction
        predicted_label = my_svm.predict(current_frame_features);
        # Print the prediction on our frame
        display_text = "Emotion: " + str(predicted_label);
        font = cv2.FONT_HERSHEY_SIMPLEX;
        cv2.putText(frame, display_text, (10, 50), font, 1, (255,255,255), 2, cv2.LINE_AA);
        # Use open CV to display the final camera frame
        cv2.imshow('Video', frame);
        # implement way to discontinue the application
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    video_capture.release();
    # destroy window
    cv2.destroyAllWindows();
2018-04-04 06:23:20 -0600 received badge  Scholar (source)
2018-04-04 06:23:16 -0600 commented answer How to predict HOG features each frame with trained SVM classifier (and possibly get the accuracy of the prediction)

Thanks for your reply! I was able to reshape it, by making current_frame_features a new list and appending a feature for

2018-04-04 05:20:00 -0600 asked a question How to predict HOG features each frame with trained SVM classifier (and possibly get the accuracy of the prediction)

How to predict HOG features each frame with trained SVM classifier (and possibly get the accuracy of the prediction) I c