1 | initial version |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all of the circles (including one elliptical defect that was identified as a circle).
2 | No.2 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all of the circles (including one elliptical defect that was identified as a circle).
3 | No.3 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all of the circles (including one elliptical defect that was identified as a circle).
I can't seem to attach images to this answer, so I put the altered image on GitHub: https://github.com/sjhalayka/random_images/blob/master/circles.jpg
My Hough function call looks like:
using namespace cv;
using namespace std;
int main(void) { Mat frame = imread("circles.jpg");
cvtColor(frame, frame, CV_BGR2GRAY);
// Find the two circles.
vector<Vec3f> circles;
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
cvtColor(frame, frame, CV_GRAY2BGR);
for (size_t i = 0; i < circles.size(); i++)
{
Point center(cvRound(circles[i][0]), cvRound(circles[i][1]));
int radius = cvRound(circles[i][2]);
circle(frame, center, 3, Scalar(0, 255, 0), -1, 8, 0);
circle(frame, center, radius, Scalar(0, 0, 255), 3, 8, 0);
}
imshow("Hough Circles", frame);
waitKey(0);
return 0;
}
4 | No.4 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all of the circles (including one elliptical defect that was identified as a circle).
I can't seem to attach images to this answer, so I put the altered image on GitHub: https://github.com/sjhalayka/random_images/blob/master/circles.jpg
My Hough function call looks like:
using namespace cv;
using namespace std;
int main(void) { Mat frame = imread("circles.jpg");
cvtColor(frame, frame, CV_BGR2GRAY);
// Find the two circles.
vector<Vec3f> circles;
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
cvtColor(frame, frame, CV_GRAY2BGR);
for (size_t i = 0; i < circles.size(); i++)
{
Point center(cvRound(circles[i][0]), cvRound(circles[i][1]));
int radius = cvRound(circles[i][2]);
circle(frame, center, 3, Scalar(0, 255, 0), -1, 8, 0);
circle(frame, center, radius, Scalar(0, 0, 255), 3, 8, 0);
}
imshow("Hough Circles", frame);
waitKey(0);
return 0;
}
5 | No.5 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all of the circles (including one elliptical defect that was identified as a circle).
I can't seem to attach images to this answer, so I put the altered image on GitHub: https://github.com/sjhalayka/random_images/blob/master/circles.jpg
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
6 | No.6 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all of the circles (including one elliptical defect that was identified as a circle).
I can't seem to attach images to this answer, so I put the altered image on GitHub: https://github.com/sjhalayka/random_images/blob/master/circles.jpg
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
7 | No.7 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all 15 of the circles (including (plus one elliptical defect that was identified as a 16th circle).
I can't seem to attach images to this answer, so I put the altered image on GitHub: https://github.com/sjhalayka/random_images/blob/master/circles.jpg
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
8 | No.8 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle).
I can't seem to attach images to this answer, so I put Here is the altered image on GitHub: https://github.com/sjhalayka/random_images/blob/master/circles.jpgthat I am describing:
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
9 | No.9 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle).
Here is the altered image that I am describing:
Here is the output, with the circles in red:
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
10 | No.10 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle).
Here is the altered image that I am describing:
Here is the output, with the circles in red:
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
11 | No.11 Revision |
@AdhilIqbal -- You need need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle).
Here is the altered image that I am describing:
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
12 | No.12 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle).circle). In other words, it works perfectly.
Here is the altered image that I am describing:
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
13 | No.13 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly.
Here is the altered image that I am describing:
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
The results are shown, where circles are in red, and have green centres:
14 | No.14 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly.
Here is the altered image that I am describing:
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
The results are shown, where circles are in red, and have green centres:
15 | No.15 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly.
Here is the altered image that I am describing:
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
16 | No.16 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly.
Here is the altered image that I am describing:describing (hurts the eyes, doesn't it?):
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
17 | No.17 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly.
Here Below is the altered image that I am describing (hurts describing. It hurts the eyes, doesn't it?):it?
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
18 | No.18 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly.perfectly, and it's about as simple as it gets.
Below is the altered image that I am describing. It hurts the eyes, doesn't it?
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
19 | No.19 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly, and it's about as simple as it gets.
Below is the altered image that I am describing. It hurts the eyes, doesn't it?it? Well it's eye candy to the Hough circle transformation.
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
20 | No.20 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly, and it's about as simple as it gets.
Below is the altered image that I am describing. It hurts the eyes, doesn't it? Well it's quinncunxial eye candy to the Hough circle transformation.
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
21 | No.21 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly, and it's about as simple as it gets.
Below is the altered image that I am describing. It hurts the eyes, doesn't it? Well it's quinncunxial quincunxesque eye candy to the Hough circle transformation.
My Hough circle transform function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
22 | No.22 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly, and it's about as simple as it gets.
Below is the altered image that I am describing. It hurts the eyes, doesn't it? Well it's quincunxesque eye candy to the Hough circle transformation.
My Hough circle transform transformation function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
23 | No.23 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly, and it's about as simple as it gets.
Below is the altered image that I am describing. It hurts the eyes, doesn't it? Well it's quincunxesque eye candy to the Hough circle transformation.
My Hough circle transformation function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
You know how big the radii of the 15 circles are. Take the mean radius. Any white region much smaller or larger than this mean radius is likely a defect.
24 | No.24 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly, and it's about as simple as it gets.
Below is the altered image that I am describing. It hurts the eyes, doesn't it? Well it's quincunxesque eye candy to the Hough circle transformation.
My Hough circle transformation function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
You know how big the radii of the 15 circles are. Take the mean radius. Any white region with a radius much smaller or larger than this mean radius is likely a defect.
25 | No.25 Revision |
@AdhilIqbal -- You need to alter your image before you can run the Hough circle transformation on it -- do a Canny()
edge detection on it, and then fill in (floodFill()
) all but the largest region to get a black and white (binary) image. That stops false positives (circles that appear out of the noise) from occurring, as well as finds all 15 of the circles (plus one elliptical defect that was identified as a 16th circle). In other words, it works perfectly, and it's about as simple as it gets.
Below is the altered image that I am describing. It hurts the eyes, doesn't it? Well it's quincunxesque eye candy to the Hough circle transformation.transformation. You really need to think like the computer.
My Hough circle transformation function call looks like:
// Parameter values are very much obtained by trial and error
HoughCircles(frame, // input
circles, // output
CV_HOUGH_GRADIENT, // method
1, // dp
5, // minimum distance
5, // param1
5, // param2
0, // minimum radius
25); // maximum radius
You know how big the radii of the 15 circles are. Take the mean radius. Any white region with a radius much smaller or larger than this mean radius is likely a defect.