{"action":"created","issue":{"url":"https://api.github.com/repos/tzutalin/dlib-android/issues/46","repository_url":"https://api.github.com/repos/tzutalin/dlib-android","labels_url":"https://api.github.com/repos/tzutalin/dlib-android/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/tzutalin/dlib-android/issues/46/comments","events_url":"https://api.github.com/repos/tzutalin/dlib-android/issues/46/events","html_url":"https://github.com/tzutalin/dlib-android/issues/46","id":218831300,"number":46,"title":"Enhancement: Accept Grayscale as Input","user":{"login":"EzequielAdrianM","id":8314884,"avatar_url":"https://avatars2.githubusercontent.com/u/8314884?v=4","gravatar_id":"","url":"https://api.github.com/users/EzequielAdrianM","html_url":"https://github.com/EzequielAdrianM","followers_url":"https://api.github.com/users/EzequielAdrianM/followers","following_url":"https://api.github.com/users/EzequielAdrianM/following{/other_user}","gists_url":"https://api.github.com/users/EzequielAdrianM/gists{/gist_id}","starred_url":"https://api.github.com/users/EzequielAdrianM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EzequielAdrianM/subscriptions","organizations_url":"https://api.github.com/users/EzequielAdrianM/orgs","repos_url":"https://api.github.com/users/EzequielAdrianM/repos","events_url":"https://api.github.com/users/EzequielAdrianM/events{/privacy}","received_events_url":"https://api.github.com/users/EzequielAdrianM/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-03T05:08:28Z","updated_at":"2017-12-08T06:52:35Z","closed_at":"2017-04-05T03:35:34Z","author_association":"NONE","body":"Currently when detection is performed, the code reads the channels of a Mat object as input. But if it is in grayscale (Channels == 1) it is converted again to color:\r\n\r\ndetector.h\r\n```\r\nvirtual inline int det(cv::Mat& image) {\r\n    if(image.empty()) return 0;\r\n    if(image.channels() == 1) {\r\n        cv::cvtColor(image, image, CV_GRAY2BGR);\r\n    } CHECK(image.channels() == 3);\r\n    dlib::cv_image<dlib::bgr_pixel> img(image);\r\n    mRets = mFaceDetector(img);\r\n    return mRets.size();\r\n}\r\n```\r\nHowever, the [Dlib documentation](http://dlib.net/imaging.html) points out that: \"Any built in scalar type may be used as a grayscale pixel type. For example, unsigned char, int, double, etc.\"\r\nSo bgr_pixel type is not the only alternative."},"comment":{"url":"https://api.github.com/repos/tzutalin/dlib-android/issues/comments/350187825","html_url":"https://github.com/tzutalin/dlib-android/issues/46#issuecomment-350187825","issue_url":"https://api.github.com/repos/tzutalin/dlib-android/issues/46","id":350187825,"user":{"login":"e-snail","id":685526,"avatar_url":"https://avatars0.githubusercontent.com/u/685526?v=4","gravatar_id":"","url":"https://api.github.com/users/e-snail","html_url":"https://github.com/e-snail","followers_url":"https://api.github.com/users/e-snail/followers","following_url":"https://api.github.com/users/e-snail/following{/other_user}","gists_url":"https://api.github.com/users/e-snail/gists{/gist_id}","starred_url":"https://api.github.com/users/e-snail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-snail/subscriptions","organizations_url":"https://api.github.com/users/e-snail/orgs","repos_url":"https://api.github.com/users/e-snail/repos","events_url":"https://api.github.com/users/e-snail/events{/privacy}","received_events_url":"https://api.github.com/users/e-snail/received_events","type":"User","site_admin":false},"created_at":"2017-12-08T06:52:35Z","updated_at":"2017-12-08T06:52:35Z","author_association":"NONE","body":"Thanks!\r\nI followed the method u mentioned, another error came out:\r\nE/cv::error(): OpenCV Error: Assertion failed (!fixedType() || ((Mat*)obj)->type() == mtype) in void cv::_OutputArray::create(cv::Size, int, int, bool, int) const, file /Volumes/Linux/builds/master_pack-android/opencv/modules/core/src/matrix.cpp, line 2191\r\n\r\nwhen executing\r\n\r\ncv::cvtColor(image, image, CV_BGR2GRAY);"}}
{"actor":{"display_login":"e-snail"}}