{"action":"closed","issue":{"url":"https://api.github.com/repos/Itseez/opencv/issues/5702","labels_url":"https://api.github.com/repos/Itseez/opencv/issues/5702/labels{/name}","comments_url":"https://api.github.com/repos/Itseez/opencv/issues/5702/comments","events_url":"https://api.github.com/repos/Itseez/opencv/issues/5702/events","html_url":"https://github.com/Itseez/opencv/issues/5702","id":118435577,"number":5702,"title":"Regarding the error message \"The data should normally be NULL\"","user":{"login":"soboh","id":3941615,"avatar_url":"https://avatars.githubusercontent.com/u/3941615?v=3","gravatar_id":"","url":"https://api.github.com/users/soboh","html_url":"https://github.com/soboh","followers_url":"https://api.github.com/users/soboh/followers","following_url":"https://api.github.com/users/soboh/following{/other_user}","gists_url":"https://api.github.com/users/soboh/gists{/gist_id}","starred_url":"https://api.github.com/users/soboh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soboh/subscriptions","organizations_url":"https://api.github.com/users/soboh/orgs","repos_url":"https://api.github.com/users/soboh/repos","events_url":"https://api.github.com/users/soboh/events{/privacy}","received_events_url":"https://api.github.com/users/soboh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Itseez/opencv/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/category:%20python%20bindings","name":"category: python bindings","color":"ededed"},{"url":"https://api.github.com/repos/Itseez/opencv/labels/priority:%20normal","name":"priority: normal","color":"A38700"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-23T17:52:24Z","updated_at":"2015-12-22T11:14:07Z","closed_at":"2015-12-22T11:14:07Z","body":"I have compiled OpenCV 3.0.0 for python on Windows.\r\nWhen I tried to run the code bellow I got this error message: \"The data should normally be NULL!\" \r\n```.py\r\nimport numpy as np\r\nimport cv2\r\n\r\nimg1 = cv2.imread('C:\\\\Users\\\\soboh\\\\Documents\\\\pcb.jpg',0)          # queryImage\r\nimg2 = cv2.imread('C:\\\\Users\\\\soboh\\\\Documents\\\\pcb.jpg',0) # trainImage\r\n\r\nsift = cv2.xfeatures2d.SURF_create()\r\n\r\nkp1, des1 = sift.detectAndCompute(img1,None)\r\nkp2, des2 = sift.detectAndCompute(img2,None)\r\n\r\n\r\nFLANN_INDEX_KDTREE = 0\r\nindex_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5)\r\nsearch_params = dict(checks=50)   # or pass empty dictionary\r\n\r\nflann = cv2.FlannBasedMatcher(index_params,search_params)\r\n\r\nmatches = flann.knnMatch(des1,des2,k=2)\r\n```\r\nThe error happens when calling the function flann.knnMatch(). The full error message is: \r\n\"cv2.error: cv2.cpp:161: error: (-215) The data should normally be NULL! in function allocate\"\r\n\r\nSo I have opened the file cv2.cpp and looked at line 161 and found these lines of code: \r\n```.cpp\r\nif( data != 0 )\r\n{\r\nCV_Error(Error::StsAssert, \"The data should normally be NULL!\");\r\n// probably this is safe to do in such extreme case\r\nreturn stdAllocator->allocate(dims0, sizes, type, data, step, flags, usageFlags);\r\n}\r\n```\r\nso I have put the line that starts with \"CV_Error\" in a comment and compiled again the OpenCV and tried to run the same code and everything worked fine, but I am not sure that what I did is ok!!! Any help?"}}