{"action":"opened","issue":{"url":"https://api.github.com/repos/Itseez/opencv/issues/5527","labels_url":"https://api.github.com/repos/Itseez/opencv/issues/5527/labels{/name}","comments_url":"https://api.github.com/repos/Itseez/opencv/issues/5527/comments","events_url":"https://api.github.com/repos/Itseez/opencv/issues/5527/events","html_url":"https://github.com/Itseez/opencv/issues/5527","id":111676995,"number":5527,"title":"Two bugs in  CvCaptureCAM_XIMEA::setProperty (Ximea driver wrapper).","user":{"login":"hbadino","id":7607246,"avatar_url":"https://avatars.githubusercontent.com/u/7607246?v=3","gravatar_id":"","url":"https://api.github.com/users/hbadino","html_url":"https://github.com/hbadino","followers_url":"https://api.github.com/users/hbadino/followers","following_url":"https://api.github.com/users/hbadino/following{/other_user}","gists_url":"https://api.github.com/users/hbadino/gists{/gist_id}","starred_url":"https://api.github.com/users/hbadino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbadino/subscriptions","organizations_url":"https://api.github.com/users/hbadino/orgs","repos_url":"https://api.github.com/users/hbadino/repos","events_url":"https://api.github.com/users/hbadino/events{/privacy}","received_events_url":"https://api.github.com/users/hbadino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-15T18:20:38Z","updated_at":"2015-10-15T18:20:38Z","closed_at":null,"body":"Bug 1:\r\nSome properties of the camera can't be changed while acquiring images while others can be changed on the fly. For properties of the the former case, the right way to change them is to stop the acquisition (a call to xiStopAcquisition()), then change the property (xiSetProperty())and restart acquisition (xiStartAcquisition()).  One of those parameters is CV_CAP_PROP_XI_TRG_SOURCE. The current implementation in method CvCaptureCAM_XIMEA::setProperty of file cap_ximea.cpp is:\r\n\r\n    case CV_CAP_PROP_XI_TRG_SOURCE    : mvret = xiSetParamInt( hmv, XI_PRM_TRG_SOURCE, ival); break;\r\n\r\nwhile the right implementation would be something like:\r\n\r\n    case CV_CAP_PROP_XI_TRG_SOURCE    : \r\n        {\r\n            xiStopAcquisition(hmv);\r\n            mvret = xiSetParamInt( hmv, XI_PRM_TRG_SOURCE, ival); \r\n            if (mvret == XI_OK)\r\n                mvret = xiStartAcquisition(hmv);\r\n            break;\r\n        }\r\n\r\nA proper fix of the bug should include all parameters that can not be changed without stopping acquisition but I don't have a list of those parameters. \r\n\r\nBug 2:\r\nThe CvCaptureCAM_XIMEA::setProperty doesn't check if the camera has been opened and should return false if the handler is NULL.\r\n\r\nHernan\r\n\r\n"}}