Commit 4eaf9946 authored by Bellaktris's avatar Bellaktris

try to fix more errors

parent 2c6f707b
...@@ -113,10 +113,10 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co ...@@ -113,10 +113,10 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co
if (lA == lB) if (lA == lB)
{ {
/** Link from A to B **/ /** Link from A to B **/
double weightAB = dist( images[lA].at<Tp>(pA), double weightAB = dist( images[lA].at<typename Tp>(pA),
images[lA].at<Tp>(pB), images[lA].at<typename Tp>(pB),
images[lX].at<Tp>(pA), images[lX].at<typename Tp>(pA),
images[lX].at<Tp>(pB) ); images[lX].at<typename Tp>(pB) );
graph.addEdges( int(pA.y*width + pA.x), int(pB.y*width + pB.x), weightAB, weightAB); graph.addEdges( int(pA.y*width + pA.x), int(pB.y*width + pB.x), weightAB, weightAB);
} }
else else
...@@ -124,24 +124,24 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co ...@@ -124,24 +124,24 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co
int X = graph.addVtx(); int X = graph.addVtx();
/** Link from X to sink **/ /** Link from X to sink **/
double weightXS = dist( images[lA].at<Tp>(pA), double weightXS = dist( images[lA].at<typename Tp>(pA),
images[lA].at<Tp>(pB), images[lA].at<typename Tp>(pB),
images[lB].at<Tp>(pA), images[lB].at<typename Tp>(pA),
images[lB].at<Tp>(pB) ); images[lB].at<typename Tp>(pB) );
graph.addTermWeights(X, 0, weightXS); graph.addTermWeights(X, 0, weightXS);
/** Link from A to X **/ /** Link from A to X **/
double weightAX = dist( images[lA].at<Tp>(pA), double weightAX = dist( images[lA].at<typename Tp>(pA),
images[lA].at<Tp>(pB), images[lA].at<typename Tp>(pB),
images[lX].at<Tp>(pA), images[lX].at<typename Tp>(pA),
images[lX].at<Tp>(pB) ); images[lX].at<typename Tp>(pB) );
graph.addEdges( int(pA.y*width + pA.x), X, weightAX, weightAX); graph.addEdges( int(pA.y*width + pA.x), X, weightAX, weightAX);
/** Link from X to B **/ /** Link from X to B **/
double weightXB = dist( images[lX].at<Tp>(pA), double weightXB = dist( images[lX].at<typename Tp>(pA),
images[lX].at<Tp>(pB), images[lX].at<typename Tp>(pB),
images[lB].at<Tp>(pA), images[lB].at<typename Tp>(pA),
images[lB].at<Tp>(pB) ); images[lB].at<typename Tp>(pB) );
graph.addEdges(X, int(pB.y*width + pB.x), weightXB, weightXB); graph.addEdges(X, int(pB.y*width + pB.x), weightXB, weightXB);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment