The invention relates to an integrated capsule defect detection device based on machine vision. The integrated capsule defect detection device comprises an integrated box, a feeding device, an image acquisition device, a discharging device, a feeding device, a rejecting device and a central control system, has comprehensive functions, meets the operation requirements of a capsule quality inspection production line, meanwhile, is high in practicability, the central control system judges the image information of to-be-detected capsules in real time, judges whether the image information reflectslight or not, adjusts an angle of a lighting source in real time according to the position of a light reflection point, processes the capsule image information according to a computer image processingtechnology, is high in computer judgment precision and high in recognition speed, errors of manual recognition are avoided, the detection efficiency of the whole detection device is improved, meanwhile, the rotating speed of a discharging rotary plate and the conveying speed of a conveying belt are adjusted in real time according to the passing frequency of the capsules, and the problem that thecapsules are blocked due to too fast conveying or difficult to remove due to too tight arrangement on the conveying belt is solved.