The invention discloses a
visual detection method for the quality of liquid
medicine on a high-speed pharmaceutical
production line. The
visual detection method is characterized by comprising the following steps of: firstly, acquiring images, i.e., acquiring five continuous sequence images of liquid
medicine under a halted state of a
bottle after revolution at a high speed, wherein the shot images are the gray-level images; secondly, initially denoising the images, i.e., removing the dynamic interference of the
bottle wall by an offset background reduction method based on a
characteristic point; thirdly, detecting a target, i.e., removing the static interference by a difference method and a threshold-based division method; fourthly, recognizing the target, i.e., judging whether the target is a
foreign body or not according to the
continuation of the motion trail of the target, and recording the
foreign body; and fifthly, judging the target, i.e., judging whether the
foreign body is the visible foreign body or not according to whether the size of the recorded foreign body exceeds the specified range or not. The method has the advantages of high detection precision and high detection speed.