Problem with countNonZeroInRegion

Hi there, I’m writing an interactive application and need to use the function
countNonZeroInRegion. Now it is returning 0 no matter what I feed it in.

I looked at the code and found this on the function definition:

******
//TODO: test this method

if (w == 0 || h == 0) return 0;
int count = 0;

// intersect the global ROI with the region to check
ofRectangle iRoi = getIntersectionROI( getROI(), ofRectangle(x,y,w,h) );

pushROI();
setROI(iRoi);

count = cvCountNonZero( cvImage );

popROI();

return count;
******

It differs to some other definitions I’ve found on the web related to the same function.
Then I looked for the function: cvCountNonZero with the codeblocks
right button option: 'Find implementation of: ’ and there were no result…

In the same app I’m using other openCV utilities like findContours, absdiff etc… and work ok… is there any known problem with this function?

Any suggestion?

Thanks in advance!

Miguel