{"action":"created","issue":{"url":"https://api.github.com/repos/fripon/freeture/issues/17","repository_url":"https://api.github.com/repos/fripon/freeture","labels_url":"https://api.github.com/repos/fripon/freeture/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/fripon/freeture/issues/17/comments","events_url":"https://api.github.com/repos/fripon/freeture/issues/17/events","html_url":"https://github.com/fripon/freeture/issues/17","id":162723799,"number":17,"title":"Image custom size is not centered","user":{"login":"ArkadiuszRaj","id":16072469,"avatar_url":"https://avatars.githubusercontent.com/u/16072469?v=3","gravatar_id":"","url":"https://api.github.com/users/ArkadiuszRaj","html_url":"https://github.com/ArkadiuszRaj","followers_url":"https://api.github.com/users/ArkadiuszRaj/followers","following_url":"https://api.github.com/users/ArkadiuszRaj/following{/other_user}","gists_url":"https://api.github.com/users/ArkadiuszRaj/gists{/gist_id}","starred_url":"https://api.github.com/users/ArkadiuszRaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArkadiuszRaj/subscriptions","organizations_url":"https://api.github.com/users/ArkadiuszRaj/orgs","repos_url":"https://api.github.com/users/ArkadiuszRaj/repos","events_url":"https://api.github.com/users/ArkadiuszRaj/events{/privacy}","received_events_url":"https://api.github.com/users/ArkadiuszRaj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-28T16:03:10Z","updated_at":"2016-07-01T15:28:53Z","closed_at":"2016-07-01T14:51:49Z","body":"I just found that while using custom resolution, camera region is not programmed correctly. For circular fisheye lenses region shall be centered else this option is of no use. While centered, cpu consumption as well as ethernet bandwith is saved.\r\n\r\n```\r\n--- freeture/src/CameraGigeAravis.cpp\t2016-06-28 17:19:59.585273406 +0200\r\n+++ ../../freeture/src/CameraGigeAravis.cpp\t2016-06-28 17:59:35.085035756 +0200\r\n@@ -163,20 +163,19 @@\r\n \r\n     bool CameraGigeAravis::setSize(int width, int height, bool customSize) {\r\n \r\n-        if(customSize) {\r\n+        int sensor_width, sensor_height;\r\n+\r\n+        arv_camera_get_sensor_size(camera, &sensor_width, &sensor_height);\r\n+        BOOST_LOG_SEV(logger, notification) << \"Camera sensor size : \" << sensor_width << \"x\" << sensor_height;\r\n \r\n-            arv_camera_set_region(camera, 0, 0,width,height);\r\n+        if(customSize) {\r\n+            arv_camera_set_region(camera, (sensor_width - width)/2, (sensor_height - height)/2,width,height);\r\n             arv_camera_get_region (camera, NULL, NULL, &mWidth, &mHeight);\r\n             BOOST_LOG_SEV(logger, notification) << \"Camera region size : \" << mWidth << \"x\" << mHeight;\r\n \r\n         // Default is maximum size\r\n         }else {\r\n \r\n-            int sensor_width, sensor_height;\r\n-\r\n-            arv_camera_get_sensor_size(camera, &sensor_width, &sensor_height);\r\n-            BOOST_LOG_SEV(logger, notification) << \"Camera sensor size : \" << sensor_width << \"x\" << sensor_height;\r\n-\r\n             arv_camera_set_region(camera, 0, 0,sensor_width,sensor_height);\r\n             arv_camera_get_region (camera, NULL, NULL, &mWidth, &mHeight);\r\n```"},"comment":{"url":"https://api.github.com/repos/fripon/freeture/issues/comments/229976567","html_url":"https://github.com/fripon/freeture/issues/17#issuecomment-229976567","issue_url":"https://api.github.com/repos/fripon/freeture/issues/17","id":229976567,"user":{"login":"ArkadiuszRaj","id":16072469,"avatar_url":"https://avatars.githubusercontent.com/u/16072469?v=3","gravatar_id":"","url":"https://api.github.com/users/ArkadiuszRaj","html_url":"https://github.com/ArkadiuszRaj","followers_url":"https://api.github.com/users/ArkadiuszRaj/followers","following_url":"https://api.github.com/users/ArkadiuszRaj/following{/other_user}","gists_url":"https://api.github.com/users/ArkadiuszRaj/gists{/gist_id}","starred_url":"https://api.github.com/users/ArkadiuszRaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArkadiuszRaj/subscriptions","organizations_url":"https://api.github.com/users/ArkadiuszRaj/orgs","repos_url":"https://api.github.com/users/ArkadiuszRaj/repos","events_url":"https://api.github.com/users/ArkadiuszRaj/events{/privacy}","received_events_url":"https://api.github.com/users/ArkadiuszRaj/received_events","type":"User","site_admin":false},"created_at":"2016-07-01T15:28:52Z","updated_at":"2016-07-01T15:28:52Z","body":"Camera having 1920x1200 with circular fisheye lens and defined region of 1600x1200 pixels produces such an image:\r\nhttps://drive.google.com/open?id=0B5rxQmNJcvrBeEtHRVc1LWdUbEU\r\n\r\nWell, what i was after is circular lens for which only centre of the image is useful. \r\n\r\nLinked image was produced by freeture with my correction. \r\n"}}
{"actor":{"display_login":"ArkadiuszRaj"}}