Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

since the actual output is just the inverted desired one, you could achieve that by just changing the sign in your comparison, instead of :

if(cp <= (int)greyMat.at<uchar>(i,j+1))

use :

if(cp > (int)greyMat.at<uchar>(i,j+1))

since the actual output is just the inverted desired one, you could achieve that by just changing the sign in your comparison, instead of :

if(cp <= (int)greyMat.at<uchar>(i,j+1))

use :

if(cp > (int)greyMat.at<uchar>(i,j+1))

the one thing will give you a 11011010 neighbourhood, the other a 00100101 one. it's just an inversion.

but honestly, i don't think it matters (imho neither if you start counting at 'north' or 'east', nor if you walk clockwise or not).

as long as you stay consistant whithin your application, everything will be fine.