"Let's see now another recurrent technique used in computer vision.\n",

"\n",

"Find particular shapes is a recurrent problem in computer vision.\n",

"Finding particular shapes is a recurrent problem in computer vision.\n",

"\n",

"Today, we will see only an easy function to find circles in our images."

]

...

...

@@ -729,7 +729,7 @@

"cell_type": "markdown",

"metadata": {},

"source": [

"Another detail of the original image. We will try to find the circle shape.\n",

"Another detail of the original image. We will try to find the circular shapes.\n",

"\n",

"...yes like in a famous children's cartoon... "

]

...

...

@@ -756,11 +756,11 @@

"source": [

"[`cv.HoughCircles`](https://docs.opencv.org/4.3.0/dd/d1a/group__imgproc__feature.html#ga47849c3be0d0406ad3ca45db65a25d2d) is a function which exploits the [`Hough transform`](https://en.wikipedia.org/wiki/Hough_transform) to find the circular pattern in the image.\n",

"\n",

"To working this function needs one channel image, so we have converted the image to grayscale.\n",

"In order to work this function needs one channel image, so we have converted the image to grayscale.\n",

"\n",

"The function return a array contains the list of found circles, with `x` and `y` coordinate of center and the `radius`.\n",

"The function returns an array containing the list of found circles, with `x` and `y` coordinates of center and the `radius`.\n",

"\n",

"Less `minDist`, `minRadius` and `maxRadius` which are petty clear, `dp`, `param1` and `param2`are not intuitive, and they are heavily related to the `Hough transform` theory, that I will not explain to you... also because I do not know it."

"Less `minDist`, `minRadius` and `maxRadius` which are pretty clear, `dp`, `param1` and `param2`are not intuitive, and they are heavily related to the `Hough transform` theory, that I will not explain to you... because I do not know it."

]

},

{

...

...

@@ -786,11 +786,11 @@

"source": [

"Obviously(?!) the result is terrible.\n",

"\n",

"Before to go on, let's understand what we have done.\n",

"Before going on, let's understand what we have done.\n",

"\n",

"with `.copy()` method on `NumPy` array we create an copy of it.\n",

"with `.copy()` method on `NumPy` array we created a copy of it.\n",

"\n",

"The circles list are provided in float format, but the image pixels are identified by integer coordinates, so before we apply a rounding of the matrix `np.around` then we convert it to an integer notation `np.uint16`.\n",

"The circles list is provided in float format, but the image pixels are identified by integer coordinates, so before we apply a rounding of the matrix `np.around` we convert it to an integer notation `np.uint16`.\n",

"\n",

"The function [`cv.circle`](https://docs.opencv.org/4.3.0/d6/d6e/group__imgproc__draw.html#gaf10604b069374903dbd0f0488cb43670) draws a circle on an image."

]

...

...

@@ -801,7 +801,7 @@

"source": [

"Let's try to get a better result.\n",

"\n",

"As we have already said before to do any operation on an image is a smart idea to filter as much noise as possible."

"As we have already said before, to do any operation on an image is a smart idea to filter as much noise as possible."

]

},

{

...

...

@@ -824,7 +824,7 @@

"\n",

"The function [`cv.medianBlur`](https://docs.opencv.org/4.3.0/d4/d86/group__imgproc__filter.html#ga564869aa33e58769b4469101aac458f9) requires the dimension of the kernel will be used to create the blur effect.\n",

"\n",

"For simple folk, the bigger is the kernel size the more are the loss of image's information."

"For simple folk, the bigger the kernel size the more the losses of image's information."

]

},

{

...

...

@@ -850,7 +850,7 @@

"cell_type": "markdown",

"metadata": {},

"source": [

"So, a simple blur filter was been sufficient to solve our problem."

"So, a simple blur filter has been sufficient to solve our problem."