One of the critical factors in determining the quality of a material is the porosity present in it. In order to detect the porosity in the material based on image processing there is a wide catalog of heterogeneity detectors such as Canny or Laplacian filters. These operators take a region of the image and apply a convolution with a kernel to detect a defined pattern as points or lines.
{gallery}Kernels |
---|
3x3 kernel: Horizontal Derivative in Sobel detector |
Gaussian kernel: Kernel for point detector |
Gabor Kernel: Kernel for texture pattern detection |
This time, in order to reduce the processing time and reduce the pattern complexity reduction, a statistical filter is used. The statistical filter consists in the use of variance and squared mean for the detection of high value deviation regions. This operation enhances highly heterogeneous regions for porosity and scratch detection. The entire process is shown below,
The firs code associated to it is
frame = hdmi_in.readframe() kernel = (5, 5) frmMain = (frame/255.0).astype(np.float32) cv2.cvtColor(frmMain,cv2.COLOR_RGB2GRAY,dst=grayscale) cv2.blur(grayscale, kernel, dst = mu) cv2.blur(grayscale*grayscale, kernel, dst = mu2) cv2.sqrt(mu2 - mu*mu, dst = std) cv2.cvtColor((std/np.max(std)*255).astype(np.uint8), cv2.COLOR_GRAY2RGB, dst=outframe) hdmi_out.writeframe(outframe)
The Filezilla software was used to send the files to the board. and the el gato pro board is used to capture the images from the HDMI out port in the board. The el gato board allows you to validate of the processing path and verify that each component of the project transmits video.
The selected sample must be located in the center of the camera and must be properly illuminated in order to avoid poor acquisition
Finally, the processing path is shown in the next gallery
{gallery}Processing Path |
---|
Acquired Image: Image acquired from the HDMI in port |
Mean Image: Change to gray scale and applied 5x5 mean filter |
Squared Image: Change to gray scale, squared values and applied 5x5 mean filter |
Root of difference: Enhanced features of the image |
To reduce the temperature inside the processor for a long processing time, I added an aluminum heat sink for the IC, since the processor raises its temperature when the processing demand is high.
These were my preliminary results, I would like to continue the processing, but in my last test I had a problem with the video port. I am not able to continue the capture and I am trying to solve it.