An algorithm based on machine vision theory which can inspect both the foreign matters in a transparent bottle and the nomal quantity of its content is developed. After analyzing the possible cases of foreign matters, we propose the principle of split and merge for the bottle image inspection. The inspection process is simplified and the inspection time is greatly reduced. Moreover, two adjustable parameters are designed to meet different inspection sensitivity demands. The algorithm developed in this paper is implemented in C language on a Sun/Sparc workstation. In the simulation of four without-foreign matter cases, all the inspection results are correct; while in sixteen with-foreign matter cases, fourteen cases are correctly inspected. All the inspected operations can be completed from 0.25 secoonds to 0.89 seconds.