|
|
|
@ -211,7 +211,9 @@ cv::Mat ImageProcess::findCircleByBackground(const Mat &srcImg, const Mat& backg
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Mat detectImg;
|
|
|
|
Mat detectImg;
|
|
|
|
Mat src = srcImg;
|
|
|
|
Mat src = srcImg;
|
|
|
|
|
|
|
|
float centerX = 0;
|
|
|
|
|
|
|
|
float centerY = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
cv::resize(src, detectImg, cv::Size(src.cols / REAIZE, src.rows / REAIZE));
|
|
|
|
cv::resize(src, detectImg, cv::Size(src.cols / REAIZE, src.rows / REAIZE));
|
|
|
|
int bBaseX = detectImg.cols;
|
|
|
|
int bBaseX = detectImg.cols;
|
|
|
|
int bBaseY = detectImg.rows;
|
|
|
|
int bBaseY = detectImg.rows;
|
|
|
|
@ -223,8 +225,7 @@ cv::Mat ImageProcess::findCircleByBackground(const Mat &srcImg, const Mat& backg
|
|
|
|
vector<mCircle> EDCircle = edcircles.getCircles();
|
|
|
|
vector<mCircle> EDCircle = edcircles.getCircles();
|
|
|
|
double maxR = 0;
|
|
|
|
double maxR = 0;
|
|
|
|
int nIndex = -1;
|
|
|
|
int nIndex = -1;
|
|
|
|
float centerX = 0;
|
|
|
|
|
|
|
|
float centerY = 0;
|
|
|
|
|
|
|
|
double tmpmaxR = 0;
|
|
|
|
double tmpmaxR = 0;
|
|
|
|
for (int i = 0; i < EDCircle.size(); i++)
|
|
|
|
for (int i = 0; i < EDCircle.size(); i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -258,7 +259,8 @@ cv::Mat ImageProcess::findCircleByBackground(const Mat &srcImg, const Mat& backg
|
|
|
|
center.y = (EDCircle[nIndex].center.y * REAIZE);
|
|
|
|
center.y = (EDCircle[nIndex].center.y * REAIZE);
|
|
|
|
return DetectCircle(srcImg, backgroundImg, center, radius, bEqual, cParam);
|
|
|
|
return DetectCircle(srcImg, backgroundImg, center, radius, bEqual, cParam);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else */
|
|
|
|
|
|
|
|
{
|
|
|
|
center.x = centerX;
|
|
|
|
center.x = centerX;
|
|
|
|
center.y = centerY;
|
|
|
|
center.y = centerY;
|
|
|
|
radius = 0;
|
|
|
|
radius = 0;
|
|
|
|
|