本文整理汇总了C++中channel::lastColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ channel::lastColumn方法的具体用法?C++ channel::lastColumn怎么用?C++ channel::lastColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类channel
的用法示例。
在下文中一共展示了channel::lastColumn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: min
void distanceTransform::iteration4back(channel& chnl) const {
int x,y,z;
const int rowm1 = chnl.lastRow();
const int colm1 = chnl.lastColumn();
static const int deltax[6] = {1,0,-1, 0, 1,0};
static const int deltay[6] = {0,1, 0,-1, 0,1};
float minimum;
// bottom-right
if (chnl.at(rowm1,colm1) > 0) {
chnl.at(rowm1,colm1) = 1.0f+min(chnl.at(rowm1,colm1-1),
chnl.at(rowm1-1,colm1));
}
// bottom
y = rowm1;
for (x=colm1-1;x>0;--x) {
if (chnl.at(y,x) > 0) {
// valid pixel, let's check for the distance value
minimum = chnl.at(y+deltay[2],x+deltax[2]);
for (z=3;z<5;++z) {
minimum = min(minimum,chnl.at(y+deltay[z],x+deltax[z]));
}
chnl.at(y,x) = minimum+1.0f;
}
}
// bottom-left
if (chnl.at(rowm1,0) > 0) {
chnl.at(rowm1,0) = 1.0f+min(chnl.at(rowm1,1),
chnl.at(rowm1-1,0));
}
// inner of the image only...
for (y=rowm1-1;y>0;--y) {
x = colm1;
// right border
if (chnl.at(y,x) > 0) {
minimum = chnl.at(y+deltay[1],x+deltax[1]);
for (z=2;z<4;++z) {
minimum = min(minimum,chnl.at(y+deltay[z],x+deltax[z]));
}
chnl.at(y,x) = minimum+1.0f;
}
// inner of the line
for (x=colm1-1;x>0;--x) {
if (chnl.at(y,x) > 0) {
// valid pixel, let's check for the distance value
minimum = chnl.at(y+deltay[0],x+deltax[0]);
for (z=1;z<4;++z) {
minimum = min(minimum,chnl.at(y+deltay[z],x+deltax[z]));
}
chnl.at(y,x) = minimum+1.0f;
}
}
// left border
if (chnl.at(y,x) > 0) {
minimum = chnl.at(y+deltay[3],x+deltax[3]);
for (z=0;z<2;++z) {
minimum = min(minimum,chnl.at(y+deltay[z],x+deltax[z]));
}
chnl.at(y,x) = minimum+1.0f;
}
}
// upper-right
if (chnl.at(0,colm1) > 0) {
chnl.at(0,colm1) = 1.0f+min(chnl.at(0,colm1-1),
chnl.at(1,colm1));
}
// top
for (x=colm1-1;x>0;--x) {
if (chnl.at(y,x) > 0) {
// valid pixel, let's check for the distance value
minimum = chnl.at(y+deltay[0],x+deltax[0]);
for (z=1;z<3;++z) {
minimum = min(minimum,chnl.at(y+deltay[z],x+deltax[z]));
}
chnl.at(y,x) = minimum+1.0f;
}
}
// upper-left
if (chnl.at(0,0) > 0) {
//.........这里部分代码省略.........