{"action":"created","issue":{"url":"https://api.github.com/repos/Itseez/opencv/issues/5729","labels_url":"https://api.github.com/repos/Itseez/opencv/issues/5729/labels{/name}","comments_url":"https://api.github.com/repos/Itseez/opencv/issues/5729/comments","events_url":"https://api.github.com/repos/Itseez/opencv/issues/5729/events","html_url":"https://github.com/Itseez/opencv/pull/5729","id":119781768,"number":5729,"title":"Canny reworked","user":{"login":"mschoeneck","id":15895266,"avatar_url":"https://avatars.githubusercontent.com/u/15895266?v=3","gravatar_id":"","url":"https://api.github.com/users/mschoeneck","html_url":"https://github.com/mschoeneck","followers_url":"https://api.github.com/users/mschoeneck/followers","following_url":"https://api.github.com/users/mschoeneck/following{/other_user}","gists_url":"https://api.github.com/users/mschoeneck/gists{/gist_id}","starred_url":"https://api.github.com/users/mschoeneck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschoeneck/subscriptions","organizations_url":"https://api.github.com/users/mschoeneck/orgs","repos_url":"https://api.github.com/users/mschoeneck/repos","events_url":"https://api.github.com/users/mschoeneck/events{/privacy}","received_events_url":"https://api.github.com/users/mschoeneck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"vpisarev","id":2110786,"avatar_url":"https://avatars.githubusercontent.com/u/2110786?v=3","gravatar_id":"","url":"https://api.github.com/users/vpisarev","html_url":"https://github.com/vpisarev","followers_url":"https://api.github.com/users/vpisarev/followers","following_url":"https://api.github.com/users/vpisarev/following{/other_user}","gists_url":"https://api.github.com/users/vpisarev/gists{/gist_id}","starred_url":"https://api.github.com/users/vpisarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpisarev/subscriptions","organizations_url":"https://api.github.com/users/vpisarev/orgs","repos_url":"https://api.github.com/users/vpisarev/repos","events_url":"https://api.github.com/users/vpisarev/events{/privacy}","received_events_url":"https://api.github.com/users/vpisarev/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-12-01T18:47:41Z","updated_at":"2015-12-16T22:06:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Itseez/opencv/pulls/5729","html_url":"https://github.com/Itseez/opencv/pull/5729","diff_url":"https://github.com/Itseez/opencv/pull/5729.diff","patch_url":"https://github.com/Itseez/opencv/pull/5729.patch"},"body":"I have reworked the Canny edge detector by adding a parallelCanny class which can be used with OpenCVs parallel_for_. For this I used the algorithm from the tbbCanny class. I removed tbbCanny, because it should be obsolete now.\r\n\r\nI also added AVX2 intrinsics wherever possible. And in a last step I parallelized the edge tracing (final pass) section with SSE2 and AVX2 intrinsics.\r\n\r\nI built it successfully in Windows with VS12 and OpenMP and in Linux Mint 17.2 with gcc 4.8 using pthreads or OpenMP. Everythings seems to work fine, but there are a few things with which I am not satisfied:\r\n\r\n1. I have to include <queue> as a replacement for tbb's queue_concurrency because I haven't found any solution with OpenCV for that. So the second thing is, that I have to use a cv::Mutex and I have to stop higher threads with a while loop to get ordered storage. I would be happy if there is a smarter solution.\r\n\r\n2. I have parallelized the final pass with parallel_for_, too, but it seems not to give any performance benefits, so I haven't removed it , but I disabled it for the moment.\r\n\r\nI think there are more things that can be done better, but I think this is a good starting point to get general parallelsation of Canny\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Itseez/opencv/issues/comments/165267926","html_url":"https://github.com/Itseez/opencv/pull/5729#issuecomment-165267926","issue_url":"https://api.github.com/repos/Itseez/opencv/issues/5729","id":165267926,"user":{"login":"mschoeneck","id":15895266,"avatar_url":"https://avatars.githubusercontent.com/u/15895266?v=3","gravatar_id":"","url":"https://api.github.com/users/mschoeneck","html_url":"https://github.com/mschoeneck","followers_url":"https://api.github.com/users/mschoeneck/followers","following_url":"https://api.github.com/users/mschoeneck/following{/other_user}","gists_url":"https://api.github.com/users/mschoeneck/gists{/gist_id}","starred_url":"https://api.github.com/users/mschoeneck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschoeneck/subscriptions","organizations_url":"https://api.github.com/users/mschoeneck/orgs","repos_url":"https://api.github.com/users/mschoeneck/repos","events_url":"https://api.github.com/users/mschoeneck/events{/privacy}","received_events_url":"https://api.github.com/users/mschoeneck/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T22:06:12Z","updated_at":"2015-12-16T22:06:12Z","body":"@vpisarev: Thank you for your help. I am new to git, so I have some problems to find the reason why it failed to build (I have seen the message: )\r\n\r\n    . /build-2/precommit_linux64/opencv/modules/core/src/matrix.cpp:469: error: (-215) 0 <= _rowRange.start && _rowRange.start <= _rowRange.end && _rowRange.end <= m.rows in function Mat\r\n\r\nIt is related to my changes, but I can not reproduce this on my local machine. So perhabs someone can help me to fix this."}}