{"action":"created","issue":{"url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/4650","repository_url":"https://api.github.com/repos/Beep6581/RawTherapee","labels_url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/4650/labels{/name}","comments_url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/4650/comments","events_url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/4650/events","html_url":"https://github.com/Beep6581/RawTherapee/issues/4650","id":337208018,"node_id":"MDU6SXNzdWUzMzcyMDgwMTg=","number":4650,"title":"White balance Auto - new algorithm Itcwb","user":{"login":"Desmis","id":13764697,"node_id":"MDQ6VXNlcjEzNzY0Njk3","avatar_url":"https://avatars1.githubusercontent.com/u/13764697?v=4","gravatar_id":"","url":"https://api.github.com/users/Desmis","html_url":"https://github.com/Desmis","followers_url":"https://api.github.com/users/Desmis/followers","following_url":"https://api.github.com/users/Desmis/following{/other_user}","gists_url":"https://api.github.com/users/Desmis/gists{/gist_id}","starred_url":"https://api.github.com/users/Desmis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Desmis/subscriptions","organizations_url":"https://api.github.com/users/Desmis/orgs","repos_url":"https://api.github.com/users/Desmis/repos","events_url":"https://api.github.com/users/Desmis/events{/privacy}","received_events_url":"https://api.github.com/users/Desmis/received_events","type":"User","site_admin":false},"labels":[{"id":246558292,"node_id":"MDU6TGFiZWwyNDY1NTgyOTI=","url":"https://api.github.com/repos/Beep6581/RawTherapee/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"Desmis","id":13764697,"node_id":"MDQ6VXNlcjEzNzY0Njk3","avatar_url":"https://avatars1.githubusercontent.com/u/13764697?v=4","gravatar_id":"","url":"https://api.github.com/users/Desmis","html_url":"https://github.com/Desmis","followers_url":"https://api.github.com/users/Desmis/followers","following_url":"https://api.github.com/users/Desmis/following{/other_user}","gists_url":"https://api.github.com/users/Desmis/gists{/gist_id}","starred_url":"https://api.github.com/users/Desmis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Desmis/subscriptions","organizations_url":"https://api.github.com/users/Desmis/orgs","repos_url":"https://api.github.com/users/Desmis/repos","events_url":"https://api.github.com/users/Desmis/events{/privacy}","received_events_url":"https://api.github.com/users/Desmis/received_events","type":"User","site_admin":false},"assignees":[{"login":"Desmis","id":13764697,"node_id":"MDQ6VXNlcjEzNzY0Njk3","avatar_url":"https://avatars1.githubusercontent.com/u/13764697?v=4","gravatar_id":"","url":"https://api.github.com/users/Desmis","html_url":"https://github.com/Desmis","followers_url":"https://api.github.com/users/Desmis/followers","following_url":"https://api.github.com/users/Desmis/following{/other_user}","gists_url":"https://api.github.com/users/Desmis/gists{/gist_id}","starred_url":"https://api.github.com/users/Desmis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Desmis/subscriptions","organizations_url":"https://api.github.com/users/Desmis/orgs","repos_url":"https://api.github.com/users/Desmis/repos","events_url":"https://api.github.com/users/Desmis/events{/privacy}","received_events_url":"https://api.github.com/users/Desmis/received_events","type":"User","site_admin":false}],"milestone":null,"comments":19,"created_at":"2018-06-30T11:29:23Z","updated_at":"2018-07-07T06:19:08Z","closed_at":null,"author_association":"COLLABORATOR","body":"I just commit in branch \"autowblocal\" a big improvment to \"Itcwb\" - Auto iterate temperature correlation\"\r\nTo test :)\r\n\r\nHere the summary:\r\n\r\nThis algorithm try to find temperature correlation between 20 to 40 color between 98 spectral color and about 20 to 40 color found in the image, I just found the idea in the web \"correlate with chroma\" instead of RGB grey point,but I don't use any algo found on the web.\r\n\r\nI have test many many algo to find the first one that work :)\r\nProbably (sure) there are improvment to do...\r\n\r\nI have create a table temperature with temp and white point with 100 values between 2000K and 12000K we can obviously  change these values, more...with different steps\r\nI have create or recuparate and transformed 98 spectral colors from Colorchecker24, others color and my 468 colors target, or from web flowers, etc. with a step of 5nm, I think it is largey enough.\r\n\r\n1) for the cuurent raw file we create a table for each temp of RGB multipliers\r\n2) then, I choose the \"camera temp\" to initialize calculation (why not ?)\r\n3) for this temp, I calculated XYZ values for the 98 spectrals datas\r\n4) then I create for the image an \"histogram\", but for xyY (Cie 1931 color space)\r\n5) for each pixel (in fact to accelerate only 1/10 for and 1/10 for y), I determine for each couple xy, the number of occurences\r\n6) I sort this result in ascending order\r\n7) in option we can sort in another maner to take into account chroma : chromax = x - white point x, chromay = y - white point y\r\n8) then I compare this result, with spectral datas found above in 3) with deltaE (limited to chroma)\r\n9) at this point we have xyY values that match Camera temp, and spectral datas associated\r\n10) then I recalculate RGB values from xyY histogram\r\n11) after, I vary temp, between 2000K to 12000K\r\n12) RGB values are recalcualted from 10) with RGB multipliers, and then xyY are calcualted for each temp\r\n13) spectral datas choose are recalculated with temp betwen 2000K to 12000K with matrix spectral calculation, that leeds to xyY values\r\n14) I calculated for each couple xy, Student correlation (without Snedecor test)\r\n15) the good result, is the best correlation\r\n16) we have found the best temperature where color image and color refences are correlate\r\n17) after we pass this value to improccoordinator\r\n\r\nSome variables or function are not used, keep in case of.\r\nI have test with cat02 but result are not stable enough ! why ??, therefore cat02 neutralized.\r\nThis operation is done (actually) 100 times and compare Student coefficient, and keep the absolute  minimum, We can probably optimize....\r\nBut actually the goal is to find the good algorithm!\r\n\r\nI think, this algo is very good in most cases :) ...to verify of course.\r\nYou can used it in images :flowers, landscape, portrait, skin, where illuminants are \"normal\" (daylight, blackbody).\r\nYou must avoid when illuminant is non standard (fluorescent, LED...) and also, when the subject is lost in the image (some target to generate profiles).\r\n\r\nYou can change 2 parameters in option.cc:\r\n* Itcwb_thres : 20 by default ==> number of color used in final algorithm - between 10 and max 40.\r\n* Itcwb_sort : false by default, can improve algo if true, ==> sort value in something near chroma order, instead of histogram number."},"comment":{"url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/comments/403192327","html_url":"https://github.com/Beep6581/RawTherapee/issues/4650#issuecomment-403192327","issue_url":"https://api.github.com/repos/Beep6581/RawTherapee/issues/4650","id":403192327,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzE5MjMyNw==","user":{"login":"Desmis","id":13764697,"node_id":"MDQ6VXNlcjEzNzY0Njk3","avatar_url":"https://avatars1.githubusercontent.com/u/13764697?v=4","gravatar_id":"","url":"https://api.github.com/users/Desmis","html_url":"https://github.com/Desmis","followers_url":"https://api.github.com/users/Desmis/followers","following_url":"https://api.github.com/users/Desmis/following{/other_user}","gists_url":"https://api.github.com/users/Desmis/gists{/gist_id}","starred_url":"https://api.github.com/users/Desmis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Desmis/subscriptions","organizations_url":"https://api.github.com/users/Desmis/orgs","repos_url":"https://api.github.com/users/Desmis/repos","events_url":"https://api.github.com/users/Desmis/events{/privacy}","received_events_url":"https://api.github.com/users/Desmis/received_events","type":"User","site_admin":false},"created_at":"2018-07-07T06:19:08Z","updated_at":"2018-07-07T06:19:08Z","author_association":"COLLABORATOR","body":"I put a commit with:\r\na) clean code - I keep between comment variables that can be used in some cases\r\nb) rename some variables to be more readable (I hope it is so...) \r\n\r\nI think I have \"finished\", the work to find a \"new algorithm for white balance\".\r\nThis algorithm must be optimized code and speed  :), and also be sure of the 5 options settings.\r\n\r\nAs above, this algo works well with daylight and blackbody. In general (??), I think green values very different from 1. (0.5..1.5....2...3...) are due to bad illuminant (with \"holes\") as Fluorescent, or if this day the weather conditions are very different from those that prevailed in the calculations of illuminants D\r\n\r\njacques\r\n\r\n\r\n"}}
{"actor":{"display_login":"Desmis"}}