The invention discloses a machine vision automatic detection system for rivets. The machine vision automatic detection system for rivets comprises a PLC (programmable logic controller), two industrial cameras, a storage bin, a vibration feed plate, a linear rail, a mechanical rotary plate, a waste product blowing pipe, a waste product discharging trough, a salable product blowing pipe, a salable product discharging trough, discharging baffles, an image acquisition card, an industrial personal computer, a touch screen, an electromagnet, a pneumatic electromagnetic valve, an upper sensor, a lower sensor, a hole sensor, a count sensor, a stepping motor drive and a stepping motor. The detection precision of the machine vision automatic detection system for rivets is within +/-0.03mm, and the electromagnetic valve is controlled by the PLC to complete precise waste product blowing and realize separation of salable products from waste products. The final number of the salable products is accurately recorded by a counter, and a discharging port is closed according to time difference to prepare for a subsequent packaging procedure. In addition, all data are recorded in a database, and various production, client, analysis and CPK (complex processing capability index) report forms can be generated by one key.