Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minMaxLoc() and minMaxIdx() #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions bea/cv.bea
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,18 @@
}
cv::calcBackProject(&arrays[0], arrays.size(), &channels[0], *hist, *backProject, (const float**)&vrangs[0], scale, uniform);

minMaxLocRet minMaxLoc(const Mat& a);
#@orgapi void minMaxLoc(const Mat& a, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0 )
minMaxLocRet minMaxLoc(const Mat& a, const Mat& mask=cv::Mat());
#@orgapi void minMaxLoc(InputArray src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, InputArray mask=noArray())
@call
minMaxLocRet fnRetVal;
cv::minMaxLoc(*a, &fnRetVal.minVal, &fnRetVal.maxVal, NULL, NULL);
cv::minMaxLoc(*a, &fnRetVal.minVal, &fnRetVal.maxVal, &fnRetVal.minLoc, &fnRetVal.maxLoc, *mask);

minMaxIdxRet minMaxIdx(const Mat& a, const Mat& mask=cv::Mat());
#@orgapi void minMaxIdx(InputArray src, double* minVal, double* maxVal, int* minIdx=0, int* maxIdx=0, InputArray mask=noArray())
@call
minMaxIdxRet fnRetVal;
cv::minMaxIdx(*a, &fnRetVal.minVal, &fnRetVal.maxVal, &fnRetVal.minIdx, &fnRetVal.maxIdx, *mask);


@manual void cvSmooth(const Mat& src, Mat& dst, int smoothtype=CV_GAUSSIAN, int param1=3, int param2=0, double param3=0, double param4=0)

Expand Down
10 changes: 8 additions & 2 deletions bea/types.bea
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@
Size2f size
float angle

@type minMaxIdxRet
double minVal
double maxVal
int minIdx
int maxIdx

@type minMaxLocRet
double minVal
double maxVal
int minIdx
int maxIdx
Point minLoc
Point maxLoc

@type Scalar
@type std::string
Expand Down
2 changes: 1 addition & 1 deletion scripts/calcHist.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mask = new cv.Mat
hist = new cv.Mat

cv.calcHist [hsv], channels, mask, hist, 2, histSize, ranges, true, false
minMax = cv.minMaxLoc hist
minMax = cv.minMaxIdx hist

tmp = new cv.Mat

Expand Down
30 changes: 20 additions & 10 deletions src/customTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,26 @@

namespace cv{

//Helper structure used as return type for the function mixMaxLoc
struct minMaxLocRet{
double minVal;
double maxVal;
int minIdx;
int maxIdx;
minMaxLocRet(){
minVal = maxVal = 0.0;
minIdx = maxIdx = 0;
}
//Helper structure used as return type for the function mixMaxLoc
struct minMaxIdxRet{
double minVal;
double maxVal;
int minIdx;
int maxIdx;
minMaxIdxRet(){
minVal = maxVal = 0.0;
minIdx = maxIdx = 0;
}
};
struct minMaxLocRet{
double minVal;
double maxVal;
Point minLoc;
Point maxLoc;
minMaxLocRet(){
minVal = maxVal = 0.0;
minLoc = maxLoc = cv::Point(0, 0);
}
};
}

Expand Down