mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
documenting findnonzero() function
This commit is contained in:
parent
453f384bd7
commit
cfccdc9b0c
@ -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
|
|||||||
// 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 );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user