Abstract:
The surface porosity of cooked rice can reflect the structural characteristics, physical properties, and taste of cooked rice. To rapidly and accurately determine the porosity of rice surface, this paper proposes a method based on image processing technology. Taking the gaps between rice grains as the research object, the OpenCV library was used for image processing. Firstly, the rice image was converted to grayscale and segmented using the Otsu threshold method. Then, noise reduction was applied to the binarized image. The connected component analysis algorithm was utilized to extract the pore areas on the rice surface, and the porosity ratio was calculated to obtain the porosity of the rice surface. The algorithm results were also verified. The results indicated that after calculating the surface porosity of the five kinds of rice, the relative errors between the Otsu treatment method measured values and the Photoshop treatment method values of the rice test samples were 1.45%, 1.89%, 1.64%, 1.42% and 0.95%, respectively. The coefficients of variation for the measured porosity of rice surfaces all within 4%, indicating low data volatile, low dispersion, and high measurement accuracy. The porosity measurement results are close to those obtained through Photoshop processing and exhibit good reproducibility. The method can quickly and efficiently measure changes in the boundary porosity of cooked rice without the need for sampling and without damaging the rice samples themselves. It provides a new non-destructive testing technique for evaluating rice quality.