{"action":"created","issue":{"url":"https://api.github.com/repos/accord-net/framework/issues/99","repository_url":"https://api.github.com/repos/accord-net/framework","labels_url":"https://api.github.com/repos/accord-net/framework/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/accord-net/framework/issues/99/comments","events_url":"https://api.github.com/repos/accord-net/framework/issues/99/events","html_url":"https://github.com/accord-net/framework/issues/99","id":76354463,"number":99,"title":"Correlation distance normalization","user":{"login":"fdncred","id":343840,"avatar_url":"https://avatars.githubusercontent.com/u/343840?v=3","gravatar_id":"","url":"https://api.github.com/users/fdncred","html_url":"https://github.com/fdncred","followers_url":"https://api.github.com/users/fdncred/followers","following_url":"https://api.github.com/users/fdncred/following{/other_user}","gists_url":"https://api.github.com/users/fdncred/gists{/gist_id}","starred_url":"https://api.github.com/users/fdncred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdncred/subscriptions","organizations_url":"https://api.github.com/users/fdncred/orgs","repos_url":"https://api.github.com/users/fdncred/repos","events_url":"https://api.github.com/users/fdncred/events{/privacy}","received_events_url":"https://api.github.com/users/fdncred/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-05-14T13:14:35Z","updated_at":"2016-08-22T16:28:38Z","closed_at":null,"body":"Please excuse my ignorance if this is incorrect but I'm having a hard time using the CorrelationMatching class.  It seems to me like this code below should normalize the distance[] array between 0 and 1 so that one can pass in a maxDistance for general checking.  Right now I can pass in 5 for maxDistance and it works for one image but not another.  If the values were normalized I'm thinking it would work more reliably.  Feel free to me if I'm missing the point here.\r\n\r\nStarting at line 371 of CorrelationMatching.cs\r\n```C#\r\n// We should consider points that are within\r\n//  distance maxDistance apart\r\n\r\n// Compute distances from the current point\r\n//  to all points in the second image.\r\ndouble[] distances = new double[idx2.Length];\r\nfor (int i = 0; i < idx2.Length; i++)\r\n{\r\n    double dx = p1.X - points2[idx2[i]].X;\r\n    double dy = p1.Y - points2[idx2[i]].Y;\r\n    distances[i] = dx * dx + dy * dy;\r\n}\r\n\r\ncandidates = idx2.Submatrix(Matrix.Find(distances, d => d < m))\r\n```\r\nThanks,\r\nDarren"},"comment":{"url":"https://api.github.com/repos/accord-net/framework/issues/comments/241469429","html_url":"https://github.com/accord-net/framework/issues/99#issuecomment-241469429","issue_url":"https://api.github.com/repos/accord-net/framework/issues/99","id":241469429,"user":{"login":"fdncred","id":343840,"avatar_url":"https://avatars.githubusercontent.com/u/343840?v=3","gravatar_id":"","url":"https://api.github.com/users/fdncred","html_url":"https://github.com/fdncred","followers_url":"https://api.github.com/users/fdncred/followers","following_url":"https://api.github.com/users/fdncred/following{/other_user}","gists_url":"https://api.github.com/users/fdncred/gists{/gist_id}","starred_url":"https://api.github.com/users/fdncred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdncred/subscriptions","organizations_url":"https://api.github.com/users/fdncred/orgs","repos_url":"https://api.github.com/users/fdncred/repos","events_url":"https://api.github.com/users/fdncred/events{/privacy}","received_events_url":"https://api.github.com/users/fdncred/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T16:28:38Z","updated_at":"2016-08-22T16:28:38Z","body":"Last year I updated your code to include this snippet just below the original code I mentioned.\r\n\r\n```csharp\r\n//Normalize the distances array - Darren 5/20/15\r\ndouble maxDist = distances.Max();\r\nfor (int i = 0; i < distances.Length; i++)\r\n    distances[i] = distances[i] / maxDist;\r\n```\r\nBy normalizing the results I was able to make your code work with all images I compared on an even scale instead of each image returning a different value which was nearly useless for what I was trying to do. No disrespect intended.\r\n\r\nEven with this change I eventually moved to OpenCVSharp using AKAZE/KAZE to compare images and using most of OpenCVs tools to get the job done.\r\n\r\nUnfortunately I'm too far removed from the code to work on issue #74. Perhaps if there wasn't a year lag between my question and your answer I would've been better equipped to help. \r\n\r\nThanks so much for answering even though it was a long time.  You have a lot of great code here and I watch it closely and will probably use it in the future."}}
{"actor":{"display_login":"fdncred"}}