Skip to content

issue with kNearest  #21

Description

@abhiinhii

The following is the error showing

/usr/local/lib/python2.7/dist-packages/ipykernel_launcher.py:42: UserWarning: loadtxt: Empty input file: "classifications.txt"
/usr/local/lib/python2.7/dist-packages/ipykernel_launcher.py:50: UserWarning: loadtxt: Empty input file: "flattened_images.txt"

errorTraceback (most recent call last)
<ipython-input-3-d66bbb23e230> in <module>()
    140 ###################################################################################################
    141 if __name__ == "__main__":
--> 142     main()
    143 # end if

<ipython-input-3-d66bbb23e230> in main()
    122         npaROIResized = np.float32(npaROIResized)       # convert from 1d numpy array of ints to 1d numpy array of floats
    123 
--> 124         retval, npaResults, neigh_resp, dists = kNearest.findNearest(npaROIResized, k = 1)     # call KNN function find_nearest
    125 
    126         strCurrentChar = str(chr(int(npaResults[0][0])))                                             # get character from results

error: OpenCV(3.4.3) /io/opencv/modules/ml/src/knearest.cpp:312: error: (-215:Assertion failed) test_samples.type() == CV_32F && test_samples.cols == samples.cols in function 'findNearest'

I dont know what to do can anybody suggest something

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions