{"action":"created","issue":{"url":"https://api.github.com/repos/opencv/opencv/issues/12606","repository_url":"https://api.github.com/repos/opencv/opencv","labels_url":"https://api.github.com/repos/opencv/opencv/issues/12606/labels{/name}","comments_url":"https://api.github.com/repos/opencv/opencv/issues/12606/comments","events_url":"https://api.github.com/repos/opencv/opencv/issues/12606/events","html_url":"https://github.com/opencv/opencv/issues/12606","id":362675995,"node_id":"MDU6SXNzdWUzNjI2NzU5OTU=","number":12606,"title":"flann::Index does not copy features matrix","user":{"login":"wpalfi","id":18048248,"node_id":"MDQ6VXNlcjE4MDQ4MjQ4","avatar_url":"https://avatars1.githubusercontent.com/u/18048248?v=4","gravatar_id":"","url":"https://api.github.com/users/wpalfi","html_url":"https://github.com/wpalfi","followers_url":"https://api.github.com/users/wpalfi/followers","following_url":"https://api.github.com/users/wpalfi/following{/other_user}","gists_url":"https://api.github.com/users/wpalfi/gists{/gist_id}","starred_url":"https://api.github.com/users/wpalfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpalfi/subscriptions","organizations_url":"https://api.github.com/users/wpalfi/orgs","repos_url":"https://api.github.com/users/wpalfi/repos","events_url":"https://api.github.com/users/wpalfi/events{/privacy}","received_events_url":"https://api.github.com/users/wpalfi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-21T15:51:23Z","updated_at":"2018-09-24T09:12:01Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"##### System information (version)\r\n- OpenCV =>3.4.1\r\n- Operating System / Platform =>Windows\r\n- Compiler => VS15 x64\r\n\r\n##### Detailed description\r\nWhen i create a `cv::flann::Index`, it holds a pointer to the `features` matrix data. Calls to `radiusSearch` fail when the `features `matrix is destroyed or changed from outside. `cv::flann::Index` should hold a private copy of the `features` matrix instead.\r\n\r\n##### Steps to reproduce\r\n\r\n```.cpp\r\ncv::Mat1f features(1, 1, 0.f);\r\ncv::flann::Index flann_index(features, cv::flann::KDTreeIndexParams(1));\r\ncv::Mat indices, dists;\r\ncv::Mat1f query(1, 1, 0.f);\r\nEXPECT_EQ(1, flann_index.radiusSearch(query, indices, dists, 1., 32)); //ok\r\n\r\nEXPECT_EQ(features.u->refcount, 1);\r\nfeatures(0) = 100;\r\nEXPECT_EQ(1, flann_index.radiusSearch(query, indices, dists, 1., 32)); //fails\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/opencv/opencv/issues/comments/423915518","html_url":"https://github.com/opencv/opencv/issues/12606#issuecomment-423915518","issue_url":"https://api.github.com/repos/opencv/opencv/issues/12606","id":423915518,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzkxNTUxOA==","user":{"login":"wpalfi","id":18048248,"node_id":"MDQ6VXNlcjE4MDQ4MjQ4","avatar_url":"https://avatars1.githubusercontent.com/u/18048248?v=4","gravatar_id":"","url":"https://api.github.com/users/wpalfi","html_url":"https://github.com/wpalfi","followers_url":"https://api.github.com/users/wpalfi/followers","following_url":"https://api.github.com/users/wpalfi/following{/other_user}","gists_url":"https://api.github.com/users/wpalfi/gists{/gist_id}","starred_url":"https://api.github.com/users/wpalfi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wpalfi/subscriptions","organizations_url":"https://api.github.com/users/wpalfi/orgs","repos_url":"https://api.github.com/users/wpalfi/repos","events_url":"https://api.github.com/users/wpalfi/events{/privacy}","received_events_url":"https://api.github.com/users/wpalfi/received_events","type":"User","site_admin":false},"created_at":"2018-09-24T09:12:01Z","updated_at":"2018-09-24T09:12:01Z","author_association":"CONTRIBUTOR","body":"@berak I can't see your comment here, why?\r\n\r\n> copying it would be quite expensive\r\n\r\nAt least for cv::Mat it would not be expensive."}}
{"actor":{"display_login":"wpalfi"}}