Skip to content

Commit 0af5e5f

Browse files
authored
Update globalmatting.cpp
1 parent ac5f5ba commit 0af5e5f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

modules/ximgproc/src/globalmatting.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,26 @@ namespace ximgproc
1111

1212
struct IntensityComp
1313
{
14-
IntensityComp(const cv::Mat_<cv::Vec3b> &image) : image(image)
15-
{
14+
IntensityComp(const cv::Mat_<cv::Vec3b> &img_temp) : img(img_temp)
15+
{
1616

17-
}
17+
}
1818

19-
bool operator()(const cv::Point &p0, const cv::Point &p1) const
20-
{
21-
const cv::Vec3b &c0 = image(p0.y, p0.x);
22-
const cv::Vec3b &c1 = image(p1.y, p1.x);
19+
bool operator()(const cv::Point &p0, const cv::Point &p1) const
20+
{
21+
const cv::Vec3b &c0 = img(p0.y, p0.x);
22+
const cv::Vec3b &c1 = img(p1.y, p1.x);
2323

24-
return ((int)c0[0] + (int)c0[1] + (int)c0[2]) < ((int)c1[0] + (int)c1[1] + (int)c1[2]);
25-
}
24+
return ((int)c0[0] + (int)c0[1] + (int)c0[2]) < ((int)c1[0] + (int)c1[1] + (int)c1[2]);
25+
}
2626

27-
const cv::Mat_<cv::Vec3b> &image;
27+
const cv::Mat_<cv::Vec3b> &img;
2828
};
2929

3030

3131

32+
33+
3234
std::vector<cv::Point> GlobalMatting::findBoundaryPixels(const cv::Mat_<uchar> &trimap, int a, int b)
3335
{
3436
std::vector<cv::Point> result;

0 commit comments

Comments
 (0)