摘要

The traditional method of reading colorimetric pH test strips by eyes is characteristic of low efficiency and large error. This paper presents a rapid detection and quantitative analysis method by using machine vision. In this method the strip images were captured and collected by the USB camera based on Video for Median filter to the original image for preprocessing, the number of test strips and their location information in an image can be indentified with the gradient algorithm by scanning the image from up to down and left to right. When the calculated gradient is larger than that of black background, it can be thought to be the boundary point of test strip. All the points compose the boundary of test strip. The number of test strips and position information of each image can thereby be recognized according to the left and right boundaries. A window is designed with the size of 30x52 and sliding it from up to down in up-down boundary of strip, the RGB sum of all pixels is continuously calculated in the The window of minimum RGB sum is discoloration area in a strip. The color distance means the distance between two kinds of color in ROB color space which shows the similarity degree of them. The pH value of the discoloration area can be quantitatively detected by calculating the color distance between the quantified test strip and the standard color card. Multiple pH test strips can be quantitatively detected at the same time by establishing an effective software system with a test error in (-0.095, 0.015) pH unit.

全文