4 int CannyHighThreshold,
9 m_nCannyLowThreshold = CannyLowThreshold;
10 m_nCannyHighThreshold = CannyHighThreshold;
11 m_nCirclesToExtract = CirclesToExtract;
12 m_nMinRadius = minRadius;
13 m_nMaxRadius = maxRadius;
19 CByteImage* saliencyImage,
26 CVec3dArray resultListCircles(50);
27 CDynamicArrayTemplate<int> resultHits(50);
28 CVec2dArray edgePoints(10000), edgeDirections(10000);
29 CByteImage visualizationImage(sampleWindowsize, sampleWindowsize, CByteImage::eRGB24);
32 ImageProcessor::Canny(
33 origin, edgePoints, edgeDirections, m_nCannyLowThreshold, m_nCannyHighThreshold);
36 ImageProcessor::HoughTransformCircles(edgePoints,
48 Vec3d circle = resultListCircles[0];
50 for (
int i = 0; i < resultListCircles.GetSize(); i++)
52 circle = resultListCircles[i];
54 circle.x += windowCenterX - sampleWindowsize / 2;
55 circle.y += windowCenterY - sampleWindowsize / 2;
56 if (circle.x >= 0 && circle.y >= 0 && circle.x < width && circle.y < height)
58 saliencyImage->pixels[(int)circle.y * width + (
int)circle.x]++;
65 CByteImage* saliencyImage,
72 cv::Mat src(origin->height, origin->width, CV_8UC1);
73 std::vector<cv::Vec3f> resultListCircles;
76 for (
int i = 0; i < src.rows; i++)
78 for (
int j = 0; j < src.cols; j++)
80 src.at<uint8_t>(i, j) = origin->pixels[i * src.cols + j];
89 m_nCannyHighThreshold,
93 if (!resultListCircles.size())
98 for (
size_t i = 0; i < resultListCircles.size(); i++)
100 circle = resultListCircles[i];
101 circle[0] += windowCenterX - sampleWindowsize / 2;
102 circle[1] += windowCenterY - sampleWindowsize / 2;
103 if (circle[0] > 0 && circle[1] > 0 && circle[0] < width - 1 && circle[1] < height - 1)
105 for (
int j = -1; j <= 1; j++)
107 for (
int k = -1; k <= 1; k++)
109 saliencyImage->pixels[((int)circle[1] + j) * width + ((int)circle[0] + k)] =