\r
for(int i = 0; i < nr_plane; i++)\r
{\r
- T fmin_ = data_cost[i * cdisp_step1];\r
- int id = i;\r
- for(int j = 0; j < nr_plane; j++)\r
+ T minimum = TypeLimits<T>::max();\r
+ int id = 0;\r
+ for(int d = 0; d < cndisp; d++)\r
{\r
- T cur = data_cost[j * cdisp_step1];\r
- if(cur < fmin_)\r
+ T cur = data_cost[d * cdisp_step1];\r
+ if(cur < minimum)\r
{\r
- fmin_ = cur;\r
- id = j;\r
+ minimum = cur;\r
+ id = d;\r
}\r
}\r
\r
- data_cost_selected[i * cdisp_step1] = fmin_;\r
+ data_cost_selected[i * cdisp_step1] = minimum;\r
selected_disparity[i * cdisp_step1] = id;\r
- data_cost [id * cdisp_step1] = TypeLimits<T>::max();;\r
+ data_cost [id * cdisp_step1] = TypeLimits<T>::max();\r
}\r
}\r
}\r