Foreign body machine vision recognition method and device for assembly line special-shaped bottling liquid

The invention provides a machine visible recognition method used for recognizing foreign matter in profiled bottled liquid of pipelining, comprising the steps as follows: 1. a the profiled bottle is arranged at a first detection working position and the profiled bottle is inversely arranged; and black foreign matter is detected by photographing images; 2. the profiled bottle is arranged at a second detection working position and in a normal position and the white foreign matter is detected by photographing images; 3. digital image tracking processing is carried out to the obtained multi-frame serial images so as to obtain the result used for judging whether the profiled bottle is qualified or not; and 4. according to the judgment result, the unqualified bottles are removed out of the detection pipelining. The invention also discloses a machine visible recognition device used for recognizing the foreign matter in the profiled bottled liquid of pipelining. The device and the method can achieve the automatic and quick detection of the foreign matter in the liquid of the profiled bottle of the pipelining.