adding documentation for the findnonzero() function
This commit is contained in:
parent
4a1adab9b4
commit
453f384bd7
@ -545,8 +545,29 @@ The function returns the number of non-zero elements in src :
|
|||||||
*/
|
*/
|
||||||
CV_EXPORTS_W int countNonZero( InputArray src );
|
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
|
||||||
@todo document
|
|
||||||
|
The function returns the coordinates of the location of non-zero pixels in src.
|
||||||
|
The result array can be both type of Mat or vector<Point>. For example:
|
||||||
|
@code{.cpp}
|
||||||
|
cv::Mat binaryImage; // input, binary image
|
||||||
|
cv::Mat locations; // output, locations of non-zero pixels
|
||||||
|
cv::findNonZero(binaryImage, locations);
|
||||||
|
|
||||||
|
// access pixel coordinates
|
||||||
|
Point pnt = locations.at<Point>(i);
|
||||||
|
@endcode
|
||||||
|
or
|
||||||
|
@code{.cpp}
|
||||||
|
cv::Mat binaryImage; // input, binary image
|
||||||
|
vector<Point> locations; // output, locations of non-zero pixels
|
||||||
|
cv::findNonZero(binaryImage, locations);
|
||||||
|
|
||||||
|
// access pixel coordinates
|
||||||
|
Point pnt = locations[i];
|
||||||
|
@endcode
|
||||||
|
@param src single-channel array
|
||||||
|
@param idx output array with the non-zero pixel points
|
||||||
*/
|
*/
|
||||||
CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx );
|
CV_EXPORTS_W void findNonZero( InputArray src, OutputArray idx );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user