{"action":"created","issue":{"url":"https://api.github.com/repos/cdcseacave/openMVS/issues/241","repository_url":"https://api.github.com/repos/cdcseacave/openMVS","labels_url":"https://api.github.com/repos/cdcseacave/openMVS/issues/241/labels{/name}","comments_url":"https://api.github.com/repos/cdcseacave/openMVS/issues/241/comments","events_url":"https://api.github.com/repos/cdcseacave/openMVS/issues/241/events","html_url":"https://github.com/cdcseacave/openMVS/issues/241","id":248236023,"number":241,"title":"DensifyPointCloud problem: opencv error assertion failed channels() == cv_mat_cn(dtype) in cv::mat::copyto","user":{"login":"MichaleWong","id":6574543,"avatar_url":"https://avatars2.githubusercontent.com/u/6574543?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaleWong","html_url":"https://github.com/MichaleWong","followers_url":"https://api.github.com/users/MichaleWong/followers","following_url":"https://api.github.com/users/MichaleWong/following{/other_user}","gists_url":"https://api.github.com/users/MichaleWong/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaleWong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaleWong/subscriptions","organizations_url":"https://api.github.com/users/MichaleWong/orgs","repos_url":"https://api.github.com/users/MichaleWong/repos","events_url":"https://api.github.com/users/MichaleWong/events{/privacy}","received_events_url":"https://api.github.com/users/MichaleWong/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-06T09:24:33Z","updated_at":"2017-08-06T12:53:58Z","closed_at":"2017-08-06T12:53:58Z","body":"After using interfaceVisualSFM to transform the *.nvm (visualSfm) to *.mvs, I run the DensifyPointCloud，the step：Estimated depth-maps, Filtered depth-maps Fused depth-maps have finished, but at the last step, when the code run on the scene.Save(); it's broken, throw the cv:exception\r\n\r\nopen Error: Assertion failed (channels() == cv_mat_cn(dtype)) in cv::mat::copyTo, file xxxxx\\opencv\\modules\\core\\src\\copy.cpp, line 259\r\n\r\nI track the issue, when the  code in types.inl :\r\nbool SerializeSave(const TYPE& obj, std::ofstream& fs, ARCHIVE_TYPE type, unsigned flags=0)\r\n{\r\n\t// serialize out the current state\r\n\tswitch (type) {\r\n\tcase ARCHIVE_TEXT: {\r\n\t\tboost::archive::text_oarchive ar(fs, flags);\r\n\t\t_ar << obj;_  \r\n\r\n> //when it runs on the line ar<<obj, that will throw the cv:exception\r\n\r\nbreak; }\r\n...}\r\nand I go ahead to debug this, finally it runs on\r\nvoid save(Archive& ar, const cv::Mat_<_Tp>& m, const unsigned int /*version*/)\r\n{\r\n\tar & m.cols;\r\n\tar & m.rows;\r\n\tconst size_t data_size = m.cols * m.rows;\r\n\tif (m.isContinuous()) {\r\n\t\tar & boost::serialization::make_array((const _Tp*)m.ptr(), data_size);\r\n\t} else {\r\n\t\tcv::Mat_<_Tp> m_cont;\r\n\t\t_m.copyTo(m_cont);_ \r\n\r\n> //m.copyTo(m_cont)  it was broken on this line finally\r\n\r\n\t\tar & boost::serialization::make_array((const _Tp*)m_cont.ptr(), data_size);\r\n\t}\r\n}\r\n\r\nhow to fix it"},"comment":{"url":"https://api.github.com/repos/cdcseacave/openMVS/issues/comments/320505225","html_url":"https://github.com/cdcseacave/openMVS/issues/241#issuecomment-320505225","issue_url":"https://api.github.com/repos/cdcseacave/openMVS/issues/241","id":320505225,"user":{"login":"MichaleWong","id":6574543,"avatar_url":"https://avatars2.githubusercontent.com/u/6574543?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaleWong","html_url":"https://github.com/MichaleWong","followers_url":"https://api.github.com/users/MichaleWong/followers","following_url":"https://api.github.com/users/MichaleWong/following{/other_user}","gists_url":"https://api.github.com/users/MichaleWong/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaleWong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaleWong/subscriptions","organizations_url":"https://api.github.com/users/MichaleWong/orgs","repos_url":"https://api.github.com/users/MichaleWong/repos","events_url":"https://api.github.com/users/MichaleWong/events{/privacy}","received_events_url":"https://api.github.com/users/MichaleWong/received_events","type":"User","site_admin":false},"created_at":"2017-08-06T12:53:58Z","updated_at":"2017-08-06T12:53:58Z","body":"now it is solved after using the opencv 3.3, it should be a bug on opencv 3.0"}}
{"actor":{"display_login":"MichaleWong"}}