{"id":1986,"date":"2014-02-05T17:32:41","date_gmt":"2014-02-05T17:32:41","guid":{"rendered":"https:\/\/www.anagram.at\/en\/diplomarbeit\/correlation\/"},"modified":"2014-02-05T17:32:41","modified_gmt":"2014-02-05T17:32:41","slug":"correlation","status":"publish","type":"page","link":"https:\/\/www.anagram.at\/en\/diplomarbeit\/correlation\/","title":{"rendered":"Correlation"},"content":{"rendered":"<p><body><br \/>\n<!--Navigation Panel--><br \/>\n<b> Next:<\/b> <a name=\"tex2html405\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/phase-difference\/\">Phase Difference<\/a><br \/>\n<b> Up:<\/b> <a name=\"tex2html401\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/intensity-based-correspondence-analysis\/\">Intensity-based correspondence analysis<\/a><br \/>\n<b> Previous:<\/b> <a name=\"tex2html395\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/intensity-based-correspondence-analysis\/\">Intensity-based correspondence analysis<\/a><br \/>\n<!--End of Navigation Panel--><\/p>\n<h3><a name=\"SECTION00341100000000000000\"><br \/>\nCorrelation<\/a><br \/>\n<\/h3>\n<p>\nDisparity <img loading=\"lazy\" width=\"14\" height=\"20\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img33.png\" alt=\"$ d$\"\/>, in this case, is the relative displacement between two grayscale distributions. For every pixel <img loading=\"lazy\" width=\"78\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img130.png\" alt=\"$ p=(k,l)$\"\/> in the left image, a window with size <img loading=\"lazy\" width=\"43\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img131.png\" alt=\"$ m x n$\"\/> centered at the actual pixel is compared with a window which is centered at pixels <!-- MATH\n $p' = (k+d,l+d)$\n --><br \/>\n<img loading=\"lazy\" width=\"148\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img132.png\" alt=\"$ p' = (k+d,l+d)$\"\/> along the epipolar line. Figure <a href=\"#correlation\">2.19<\/a> shows the shift of the window in the right image in case of a standard geometry. In this case <!-- MATH\n $p'=(k+d,l)$\n --><br \/>\n<img loading=\"lazy\" width=\"116\" height=\"37\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img133.png\" alt=\"$ p'=(k+d,l)$\"\/>.  <\/p>\n<\/p>\n<div align=\"CENTER\"><a name=\"correspondence_img\"\/><a name=\"547\"\/><\/p>\n<table>\n<caption align=\"BOTTOM\"><strong>Figure 2.13:<\/strong><br \/>\nCorrelation based similarity &#8211; the window is shifted along the epipolar line<\/caption>\n<tr>\n<td>\n<div align=\"CENTER\">\n <img loading=\"lazy\" width=\"271\" height=\"265\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/correlation.jpg\" alt=\"Image correlation\"\/><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\nThe similarity with the highest correlation is chosen. The correlation is defined as\n<\/p>\n<p\/>\n<div align=\"CENTER\"><a name=\"correlation\"\/><!-- MATH\n begin{equation}\nC(d) = frac{sigma_{lr}^2}{sqrt{sigma_l^2 + sigma_r^2}}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"152\" height=\"65\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img134.png\" alt=\"$displaystyle C(d) = frac{sigma_{lr}^2}{sqrt{sigma_l^2 + sigma_r^2}}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.19)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nwhere <\/p>\n<p\/>\n<div align=\"CENTER\"><a name=\"variance\"\/><!-- MATH\n begin{equation}\nbegin{aligned}\nsigma_l^2 = sum limits_{i=k+d}^{k+m+d} sum limits_{j=l}^{l+n} frac{(I_l(i,j)-mu)^2)}{mn} \nsigma_r^2 = sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} frac{(I_r(i,j)-mu)^2)}{mn}\nend{aligned}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"242\" height=\"146\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img135.png\" alt=\"begin{equation*}begin{aligned}sigma_l^2 = sum limits_{i=k+d}^{k+m+d} sum ...&#10;...um limits_{j=l}^{l+n} frac{(I_r(i,j)-mu)^2)}{mn} end{aligned}end{equation*}\"\/><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nare the variances of the intensity values of the left and right image and<\/p>\n<p\/>\n<div align=\"CENTER\"><a name=\"covariance\"\/><!-- MATH\n begin{equation}\nsigma_{lr}^2 = sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} frac{(I_l(i+d,j)-mu_l)(I_r(i,j)-mu_r))}{mn}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"375\" height=\"78\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img136.png\" alt=\"$displaystyle sigma_{lr}^2 = sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} frac{(I_l(i+d,j)-mu_l)(I_r(i,j)-mu_r))}{mn}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.21)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nis the covariance. The correlation is at its maximum if the variance is minimal and the covariance is maximal. A lower threshold <img loading=\"lazy\" width=\"16\" height=\"16\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img137.png\" alt=\"$ Gamma$\"\/> is chosen, which decides whether the similarity is strong enough or not. Thus<\/p>\n<p\/>\n<div align=\"CENTER\"><!-- MATH\n begin{equation}\nd(x) =\nbegin{cases}\nd & text{if $C(d) > Gamma$  and $d = argmaxlimits_{d}C(d)$}\ninfty & text{else}\nend{cases}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"398\" height=\"100\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img138.png\" alt=\"$displaystyle d(x) = begin{cases}d &amp; text{if $C(d) &gt; Gamma$ and $d = argmaxlimits_{d}C(d)$} infty &amp; text{else} end{cases}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.22)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\n<p>\nBecause correlation takes a lot of time to compute, the sum of squared difference (SSD) is often used instead. Equation <a href=\"#ssd\">2.23<\/a> shows the equation of SSD.\n<\/p>\n<p\/>\n<div align=\"CENTER\"><a name=\"ssd\"\/><!-- MATH\n begin{equation}\nSSD(d) = sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} (I_l(i+d,j)-I_r(i,j))^2\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"339\" height=\"78\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img139.png\" alt=\"$displaystyle SSD(d) = sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} (I_l(i+d,j)-I_r(i,j))^2$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.23)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\nIf the SSD is at its minimum, the best match has been found. In this case <img loading=\"lazy\" width=\"16\" height=\"16\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img137.png\" alt=\"$ Gamma$\"\/> is an upper threshold and defines whether the result is small enough or not.  <\/p>\n<p\/>\n<div align=\"CENTER\"><!-- MATH\n begin{equation}\nd(x) =\nbegin{cases}\nd & text{if $SSD(d) < Gamma$  and $d = argminlimits_{d}SSD(d)$}\ninfty & text{else}\nend{cases}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"448\" height=\"100\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img140.png\" alt=\"$displaystyle d(x) = begin{cases}d &amp; text{if $SSD(d) &lt; Gamma$ and $d = argminlimits_{d}SSD(d)$} infty &amp; text{else} end{cases}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.24)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\n<p>\nIntensity differences in high contrast areas are more reliable than in low contrast areas. A possible solution is to normalize Equation <a href=\"#ssd\">2.23<\/a> with the local variance. <\/p>\n<\/p>\n<p\/>\n<div align=\"CENTER\"><a name=\"ssd_var\"\/><!-- MATH\n begin{equation}\nSSD(d) = frac{sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} (I_l(i+d,j)-I_r(i,j))^2}{sigma_l^2sigma_r^2}\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"338\" height=\"124\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img141.png\" alt=\"$displaystyle SSD(d) = frac{sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} (I_l(i+d,j)-I_r(i,j))^2}{sigma_l^2sigma_r^2}$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.25)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\n<p>\nAnother problem is that cameras often have different sensitivities. A solution for this problem is to normalize the image with variance and intensity. Equation <a href=\"#ssd_var\">2.25<\/a> would look like\n<\/p>\n<p\/>\n<div align=\"CENTER\"><a name=\"ssd_var_int\"\/><!-- MATH\n begin{equation}\nSSD(d) = sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} big[ frac{(I_l(i+d,j) -mu_l)}{sigma_l^2} -\nfrac{(I_r(i,j)^2 - mu_r)}{sigma_r^2}big]^2\nend{equation}\n --><\/p>\n<table cellpadding=\"0\" width=\"100%\" align=\"CENTER\">\n<tr valign=\"MIDDLE\">\n<td nowrap=\"nowrap\" align=\"CENTER\"><img loading=\"lazy\" width=\"469\" height=\"78\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img142.png\" alt=\"$displaystyle SSD(d) = sum limits_{i=k}^{k+m} sum limits_{j=l}^{l+n} big[ ...&#10;..._l(i+d,j) -mu_l)}{sigma_l^2} - frac{(I_r(i,j)^2 - mu_r)}{sigma_r^2}big]^2$\"\/><\/td>\n<td nowrap=\"nowrap\" width=\"10\" align=\"RIGHT\">\n(2.26)<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p><br clear=\"ALL\"\/><\/p>\n<p\/>\n<p>\nSo far we assumed that we have a fixed window size <img loading=\"lazy\" width=\"17\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img143.png\" alt=\"$ omega$\"\/> (m<img loading=\"lazy\" width=\"19\" height=\"33\" align=\"MIDDLE\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img144.png\" alt=\"$ times$\"\/>n). The choice of <img loading=\"lazy\" width=\"17\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img143.png\" alt=\"$ omega$\"\/> influences the resulting disparity map. If <img loading=\"lazy\" width=\"17\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img143.png\" alt=\"$ omega$\"\/> is very small, many false matches can occur, especially if the images are noisy. If <img loading=\"lazy\" width=\"17\" height=\"19\" align=\"BOTTOM\" border=\"0\" src=\"https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/https:\/\/www.anagram.at\/app\/uploads\/2014\/02\/img143.png\" alt=\"$ omega$\"\/> is very big, then the optimum is flattened and the computation time increases. Some approaches use adaptive window sizes to gain their results [<a href=\"node47.html#Kan94\">KO94<\/a>]. After calculating disparity values for all pixels, the resulting disparity map should be convolved with a median filter so that  single very unrepresentative pixel in a neighbour hood are deleted.<\/p>\n<\/p>\n<hr\/>\n<p><!--Navigation Panel--><b> Next:<\/b> <a name=\"tex2html405\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/phase-difference\/\">Phase Difference<\/a><br \/>\n<b> Up:<\/b> <a name=\"tex2html401\" href=\"https:\/\/www.anagram.at\/diplomarbeit\/intensity-based-correspondence-analysis\/\">Intensity-based correspondence analysis<\/a><br \/>\n<!--End of Navigation Panel--><\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Correlation<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1946,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":""},"categories":[],"featured_image_src":null,"featured_image_src_square":null,"_links":{"self":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages\/1986"}],"collection":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/comments?post=1986"}],"version-history":[{"count":0,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages\/1986\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/pages\/1946"}],"wp:attachment":[{"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/media?parent=1986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anagram.at\/en\/wp-json\/wp\/v2\/categories?post=1986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}