Commit cfccdc9b authored by theodore's avatar theodore

documenting findnonzero() function

parent 453f384b
...@@ -547,8 +547,10 @@ CV_EXPORTS_W int countNonZero( InputArray src ); ...@@ -547,8 +547,10 @@ CV_EXPORTS_W int countNonZero( InputArray src );
/** @brief Returns the list of locations of non-zero pixels /** @brief Returns the list of locations of non-zero pixels
The function returns the coordinates of the location of non-zero pixels in src. Given a binary matrix (likely returned from an operation such
The result array can be both type of Mat or vector<Point>. For example: as threshold(), compare(), >, ==, etc, return all of
the non-zero indices as a cv::Mat or std::vector<cv::Point> (x,y)
For example:
@code{.cpp} @code{.cpp}
cv::Mat binaryImage; // input, binary image cv::Mat binaryImage; // input, binary image
cv::Mat locations; // output, locations of non-zero pixels cv::Mat locations; // output, locations of non-zero pixels
...@@ -566,8 +568,8 @@ or ...@@ -566,8 +568,8 @@ or
// access pixel coordinates // access pixel coordinates
Point pnt = locations[i]; Point pnt = locations[i];
@endcode @endcode
@param src single-channel array @param src single-channel array (type CV_8UC1)
@param idx output array with the non-zero pixel points @param idx the output array, type of cv::Mat or std::vector<Point>, corresponding to non-zero indices in the input
*/ */
CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx ); CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx );
......
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