{"action":"created","issue":{"url":"https://api.github.com/repos/opencv/opencv/issues/12738","repository_url":"https://api.github.com/repos/opencv/opencv","labels_url":"https://api.github.com/repos/opencv/opencv/issues/12738/labels{/name}","comments_url":"https://api.github.com/repos/opencv/opencv/issues/12738/comments","events_url":"https://api.github.com/repos/opencv/opencv/issues/12738/events","html_url":"https://github.com/opencv/opencv/issues/12738","id":366647196,"node_id":"MDU6SXNzdWUzNjY2NDcxOTY=","number":12738,"title":"float16_t convertors support is incomplete","user":{"login":"cv3d","id":42140441,"node_id":"MDQ6VXNlcjQyMTQwNDQx","avatar_url":"https://avatars1.githubusercontent.com/u/42140441?v=4","gravatar_id":"","url":"https://api.github.com/users/cv3d","html_url":"https://github.com/cv3d","followers_url":"https://api.github.com/users/cv3d/followers","following_url":"https://api.github.com/users/cv3d/following{/other_user}","gists_url":"https://api.github.com/users/cv3d/gists{/gist_id}","starred_url":"https://api.github.com/users/cv3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cv3d/subscriptions","organizations_url":"https://api.github.com/users/cv3d/orgs","repos_url":"https://api.github.com/users/cv3d/repos","events_url":"https://api.github.com/users/cv3d/events{/privacy}","received_events_url":"https://api.github.com/users/cv3d/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-04T06:56:02Z","updated_at":"2018-10-04T08:41:54Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"float16_t is supported in `cv::getConvertFunc()` and `cv::getConvertScaleFunc()`, but it is not supported in `cv::getConvertElem()`. Is that intentional (if so, mind to tell me why?), or was it accidentally skipped?\r\n\r\nI understand float16_t is somehow special, but my impression is that, if `cv::getConvertFunc()` and `cv::getConvertScaleFunc()` are supportted, then `cv::getConvertElem()` should be as well.\r\n\r\nFor example, take these two test cases:\r\n```C++\r\nTEST(Core_Mat, convertTo)\r\n{\r\n    cv::Mat src((cv::Mat_<float>(1, 5) << 1, 2, 3, 4, 5));\r\n    cv::Mat dst;\r\n\r\n    ASSERT_NO_THROW(src.convertTo(dst, CV_16F));\r\n    ASSERT_NO_THROW(src.convertTo(dst, CV_16F, 2));\r\n}\r\n\r\nTEST(Core_SparseMat, convertTo)\r\n{\r\n    cv::SparseMat src((cv::Mat_<float>(1, 5) << 1, 2, 3, 4, 5));\r\n    cv::SparseMat dst;\r\n\r\n    ASSERT_NO_THROW(src.convertTo(dst, CV_16F));\r\n    ASSERT_NO_THROW(src.convertTo(dst, CV_16F, 2));\r\n}\r\n```\r\n\r\nIt is expected that both test cases pass, but currently only `Core_Mat.convertTo` passes!"},"comment":{"url":"https://api.github.com/repos/opencv/opencv/issues/comments/426934641","html_url":"https://github.com/opencv/opencv/issues/12738#issuecomment-426934641","issue_url":"https://api.github.com/repos/opencv/opencv/issues/12738","id":426934641,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjkzNDY0MQ==","user":{"login":"alalek","id":4981219,"node_id":"MDQ6VXNlcjQ5ODEyMTk=","avatar_url":"https://avatars0.githubusercontent.com/u/4981219?v=4","gravatar_id":"","url":"https://api.github.com/users/alalek","html_url":"https://github.com/alalek","followers_url":"https://api.github.com/users/alalek/followers","following_url":"https://api.github.com/users/alalek/following{/other_user}","gists_url":"https://api.github.com/users/alalek/gists{/gist_id}","starred_url":"https://api.github.com/users/alalek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alalek/subscriptions","organizations_url":"https://api.github.com/users/alalek/orgs","repos_url":"https://api.github.com/users/alalek/repos","events_url":"https://api.github.com/users/alalek/events{/privacy}","received_events_url":"https://api.github.com/users/alalek/received_events","type":"User","site_admin":false},"created_at":"2018-10-04T08:41:54Z","updated_at":"2018-10-04T08:41:54Z","author_association":"CONTRIBUTOR","body":"FP16 is usually used to reduce storage size and/or memory bandwidth during computation.\r\nUsing FP16 in sparse matrix is something useless in comparison with FP32 (optimization effect is almost zero - storage for indexing is still has the same size)."}}
{"actor":{"display_login":"alalek"}}