{"action":"closed","issue":{"url":"https://api.github.com/repos/cmpute/pypcl/issues/1","repository_url":"https://api.github.com/repos/cmpute/pypcl","labels_url":"https://api.github.com/repos/cmpute/pypcl/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/cmpute/pypcl/issues/1/comments","events_url":"https://api.github.com/repos/cmpute/pypcl/issues/1/events","html_url":"https://github.com/cmpute/pypcl/issues/1","id":243068340,"node_id":"MDU6SXNzdWUyNDMwNjgzNDA=","number":1,"title":"Accuracy difference between np.cov and pcl.common.compute_mean_and_covariance_matrix","user":{"login":"cmpute","id":9154441,"node_id":"MDQ6VXNlcjkxNTQ0NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/9154441?v=4","gravatar_id":"","url":"https://api.github.com/users/cmpute","html_url":"https://github.com/cmpute","followers_url":"https://api.github.com/users/cmpute/followers","following_url":"https://api.github.com/users/cmpute/following{/other_user}","gists_url":"https://api.github.com/users/cmpute/gists{/gist_id}","starred_url":"https://api.github.com/users/cmpute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmpute/subscriptions","organizations_url":"https://api.github.com/users/cmpute/orgs","repos_url":"https://api.github.com/users/cmpute/repos","events_url":"https://api.github.com/users/cmpute/events{/privacy}","received_events_url":"https://api.github.com/users/cmpute/received_events","type":"User","site_admin":false},"labels":[{"id":624547432,"node_id":"MDU6TGFiZWw2MjQ1NDc0MzI=","url":"https://api.github.com/repos/cmpute/pypcl/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"closed","locked":false,"assignee":{"login":"cmpute","id":9154441,"node_id":"MDQ6VXNlcjkxNTQ0NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/9154441?v=4","gravatar_id":"","url":"https://api.github.com/users/cmpute","html_url":"https://github.com/cmpute","followers_url":"https://api.github.com/users/cmpute/followers","following_url":"https://api.github.com/users/cmpute/following{/other_user}","gists_url":"https://api.github.com/users/cmpute/gists{/gist_id}","starred_url":"https://api.github.com/users/cmpute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmpute/subscriptions","organizations_url":"https://api.github.com/users/cmpute/orgs","repos_url":"https://api.github.com/users/cmpute/repos","events_url":"https://api.github.com/users/cmpute/events{/privacy}","received_events_url":"https://api.github.com/users/cmpute/received_events","type":"User","site_admin":false},"assignees":[{"login":"cmpute","id":9154441,"node_id":"MDQ6VXNlcjkxNTQ0NDE=","avatar_url":"https://avatars0.githubusercontent.com/u/9154441?v=4","gravatar_id":"","url":"https://api.github.com/users/cmpute","html_url":"https://github.com/cmpute","followers_url":"https://api.github.com/users/cmpute/followers","following_url":"https://api.github.com/users/cmpute/following{/other_user}","gists_url":"https://api.github.com/users/cmpute/gists{/gist_id}","starred_url":"https://api.github.com/users/cmpute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmpute/subscriptions","organizations_url":"https://api.github.com/users/cmpute/orgs","repos_url":"https://api.github.com/users/cmpute/repos","events_url":"https://api.github.com/users/cmpute/events{/privacy}","received_events_url":"https://api.github.com/users/cmpute/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-07-14T18:00:51Z","updated_at":"2019-01-03T02:41:56Z","closed_at":"2019-01-03T02:41:56Z","author_association":"OWNER","body":"Reproduction code:\r\n```python\r\nrdata = np.random.rand(1000, 3)\r\ncloudx = rdata[:, 0]\r\ncloudy = rdata[:, 1]\r\ncloudz = rdata[:, 2]\r\ncoef_xx = np.mean(cloudx * cloudx)\r\ncoef_xy = np.mean(cloudx * cloudy)\r\ncoef_xz = np.mean(cloudx * cloudz)\r\ncoef_yy = np.mean(cloudy * cloudy)\r\ncoef_yz = np.mean(cloudy * cloudz)\r\ncoef_zz = np.mean(cloudz * cloudz)\r\ncoef_x, coef_y, coef_z = np.mean(rdata, axis=0)\r\ncov = np.zeros((3, 3))\r\ncov[0, 0] = coef_xx - coef_x**2\r\ncov[1, 1] = coef_yy - coef_y**2\r\ncov[2, 2] = coef_zz - coef_z**2\r\ncov[0, 1] = cov[1, 0] = coef_xy - coef_x*coef_y\r\ncov[0, 2] = cov[2, 0] = coef_xz - coef_x*coef_z\r\ncov[1, 2] = cov[2, 1] = coef_yz - coef_y*coef_z\r\n\r\nnpcov = np.cov(rdata, rowvar=False)\r\nprint((npcov - cov) / npcov)\r\n```\r\n\r\nRunning for times and the outputs are the same:\r\n```\r\n[[ 0.001  0.001  0.001]\r\n [ 0.001  0.001  0.001]\r\n [ 0.001  0.001  0.001]]\r\n```\r\n\r\nIf test the difference in `pcl.features.normal.compute_point_normal()`, the output matrix always consists of scalar 0.2, which is quite large. I think the problem comes with the accuracy configuration of numpy, however, I've got no idea to deal with it now.\r\n\r\nThere's another issue in normal estimation that the estimated normals are almost all the same, only few of them at the beginning are not the same. I believe this is the consequence of the deviation in covariance matrix computation."}}
{"actor":{"display_login":"cmpute"}}