{"action":"created","issue":{"url":"https://api.github.com/repos/anuranbaka/OpenDTAM/issues/43","labels_url":"https://api.github.com/repos/anuranbaka/OpenDTAM/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/anuranbaka/OpenDTAM/issues/43/comments","events_url":"https://api.github.com/repos/anuranbaka/OpenDTAM/issues/43/events","html_url":"https://github.com/anuranbaka/OpenDTAM/issues/43","id":113029394,"number":43,"title":"2.4.9_backport : Optimizer doesn't work well","user":{"login":"KazukiSakai","id":8166529,"avatar_url":"https://avatars.githubusercontent.com/u/8166529?v=3","gravatar_id":"","url":"https://api.github.com/users/KazukiSakai","html_url":"https://github.com/KazukiSakai","followers_url":"https://api.github.com/users/KazukiSakai/followers","following_url":"https://api.github.com/users/KazukiSakai/following{/other_user}","gists_url":"https://api.github.com/users/KazukiSakai/gists{/gist_id}","starred_url":"https://api.github.com/users/KazukiSakai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KazukiSakai/subscriptions","organizations_url":"https://api.github.com/users/KazukiSakai/orgs","repos_url":"https://api.github.com/users/KazukiSakai/repos","events_url":"https://api.github.com/users/KazukiSakai/events{/privacy}","received_events_url":"https://api.github.com/users/KazukiSakai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-23T14:20:46Z","updated_at":"2015-10-27T14:09:13Z","closed_at":null,"body":"Hi, all.\r\n\r\nI run OpenDTAM-2.4.9backport, but optimizer doesn't work well.\r\nHow should I do to fix this problem?\r\n\r\nI'd like to get high quality results like  #38 (I don't know what branch he used to record #38's video, but anyway this problem is not related now).\r\nAnd as I watched this video, the initial image(a and d) looks similar as my results, so initial part is not problem, I think.\r\nIs it optimization parameter problem? or bug?\r\n\r\nIn my understanding, this is optimization part, right?\r\n\r\n\r\n\r\n\r\n    bool doneOptimizing; int Acount=0; int QDcount=0;\r\n    do{\r\n        cout<<\"Theta: \"<< optimizer.getTheta()<<endl;\r\n        cout<<\"Acount \" << Acount << \", QDcount \" << QDcount << endl;\r\n        if(Acount==0) gpause();\r\n        a.download(ret);//GPU(a)->CPU(ret)\r\n        pfShow(\"A function\", ret, 0, cv::Vec2d(0, layers));\r\n        for (int i = 0; i < 10; i++) {\r\n            d=denoiser(a,optimizer.epsilon,optimizer.getTheta());//operater() in DepthmapDenoiseWeightedHuber.cpp\r\n            QDcount++;\r\n             //denoiser._qx.download(ret);\r\n             //pfShow(\"Q function:x direction\", ret, 0, cv::Vec2d(-1, 1));\r\n             //denoiser._qy.download(ret);\r\n             //pfShow(\"Q function:y direction\", ret, 0, cv::Vec2d(-1, 1));\r\n             d.download(ret);\r\n             pfShow(\"D function\", ret, 0, cv::Vec2d(0, layers));\r\n       }\r\n       doneOptimizing=optimizer.optimizeA(d,a);\r\n       Acount++;        \r\n    }while(!doneOptimizing);\r\n    cout << \"done optimizing!\" << endl;\r\n\r\nHere is the parameter I used(default setting).\r\n\r\n* imagesPerCV = 2\r\n* layers = 32\r\n* thetaStart =  20.0;\r\n* thetaMin   =   1.0;\r\n* thetaStep  =    .97;\r\n* epsilon    =    .1;\r\n* lambda     =    .01;\r\n\r\nAnd this is my results(after optimization), and before optimization I  got same (a, d) image.\r\nAnd also I downloaded OpenDTAM2.4.9-backport and I don't change the code(for debug, I added some cout statement, but I think cout statement doesn't change any variables.)\r\n\r\n![screenshot from 2015-10-23 23 06 49](https://cloud.githubusercontent.com/assets/8166529/10694752/e883869a-79da-11e5-85b0-76eada1023de.png)\r\n"},"comment":{"url":"https://api.github.com/repos/anuranbaka/OpenDTAM/issues/comments/151507470","html_url":"https://github.com/anuranbaka/OpenDTAM/issues/43#issuecomment-151507470","issue_url":"https://api.github.com/repos/anuranbaka/OpenDTAM/issues/43","id":151507470,"user":{"login":"anuranbaka","id":4740747,"avatar_url":"https://avatars.githubusercontent.com/u/4740747?v=3","gravatar_id":"","url":"https://api.github.com/users/anuranbaka","html_url":"https://github.com/anuranbaka","followers_url":"https://api.github.com/users/anuranbaka/followers","following_url":"https://api.github.com/users/anuranbaka/following{/other_user}","gists_url":"https://api.github.com/users/anuranbaka/gists{/gist_id}","starred_url":"https://api.github.com/users/anuranbaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuranbaka/subscriptions","organizations_url":"https://api.github.com/users/anuranbaka/orgs","repos_url":"https://api.github.com/users/anuranbaka/repos","events_url":"https://api.github.com/users/anuranbaka/events{/privacy}","received_events_url":"https://api.github.com/users/anuranbaka/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T14:09:13Z","updated_at":"2015-10-27T14:09:13Z","body":"I have a test for messed up g values: \r\ncomment out all but \" _gx=1; _gy=1;\" In the following code block in \r\nDepthmapDenoiseWeightedHuber.cpp:\r\n\r\n    if(!visibleLightImage.empty())\r\n        cacheGValues();\r\n    if(!cachedG){\r\n    //         _gx.setTo(1,cvStream);\r\n        _gx=1;\r\n    //         _gy.setTo(1,cvStream);\r\n        _gy=1;\r\n    }\r\nThat should cause the d function to flatten out. If not, something is really wrong."}}