1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #22346 from fengyuentau:mat1d_part1

Changes separated from Mat 1D support in core #18594 (#22346)
This commit is contained in:
Yuantao Feng
2022-09-09 17:56:30 +08:00
committed by GitHub
parent 65d66a05dd
commit 9dc844a6e1
3 changed files with 106 additions and 5 deletions
+14 -3
View File
@@ -1565,13 +1565,24 @@ void cv::minMaxLoc( InputArray _img, double* minVal, double* maxVal,
{
CV_INSTRUMENT_REGION();
CV_Assert(_img.dims() <= 2);
int dims = _img.dims();
CV_CheckLE(dims, 2, "");
minMaxIdx(_img, minVal, maxVal, (int*)minLoc, (int*)maxLoc, mask);
if( minLoc )
std::swap(minLoc->x, minLoc->y);
{
if (dims == 2)
std::swap(minLoc->x, minLoc->y);
else
minLoc->y = 0;
}
if( maxLoc )
std::swap(maxLoc->x, maxLoc->y);
{
if (dims == 2)
std::swap(maxLoc->x, maxLoc->y);
else
maxLoc->y = 0;
}
}
enum class ReduceMode