An inspection device for inspecting the rings and the necks of containers, the device comprising: • movable equipment driven relative to a frame with reciprocating motion along a travel direction parallel to the axis of symmetry of the containers and with a maximum stroke, the movable equipment being provided with an external gauge for inspecting the outsides of the rings of containers and with an internal gauge for inspecting the insides of the rings and of the necks of containers, the external and internal gauges (14, 15) being mounted to be movable independently of each other and relative to the movable equipment in a travel direction parallel to the travel direction of the movable equipment; • a measurement system for measuring the position of the movable equipment relative to the frame, in the travel direction, the measurements of the position of the movable equipment being supplied to a processor unit; • a detection system for detecting contact occurring between the internal gauge and the container during movement of the movable equipment, occurrences of contact being supplied to the processor unit; • a detection system for detecting contact occurring between the external gauge and the container during movement of the movable equipment, occurrences of contact being supplied to the processor unit; and • a processor unit acting as a function of the measurements of the position of the movable equipment and of occurrences of contact between the gauges (14, 15) and the container to determine whether the rings and/or the necks of the containers have dimensions that are in compliance and to determine the types of defect for containers that are dimensionally not in compliance; the device being characterized in that each detection system (35, 37) for detecting contact with a gauge comprises: • an emitter and receiver system for emitting and receiving a light beam in a direction parallel to the travel direction of the movable equipment and over a segment of length that is not less than the maximum stroke of the movable equipment, the emitter and receiver system being carried by the frame; and • a movement transformation mechanism (72, 73) carried by the movable equipment, for transforming the travel movement of the gauge (14, 15) relative to the movable equipment into a movement that obstructs or ceases to obstruct the light beam in order to detect the occurrence of contact with the gauge regardless of the position of the movable equipment. • movable equipment driven relative to a frame with reciprocating motion along a travel direction parallel to the axis of symmetry of the containers and with a maximum stroke, the movable equipment being provided with an external gauge for inspecting the outsides of the rings of containers and with an internal gauge for inspecting the insides of the rings and of the necks of containers, the external and internal gauges (14, 15) being mounted to be movable independently of each other and relative to the movable equipment in a travel direction parallel to the travel direction of the movable equipment; • a measurement system for measuring the position of the movable equipment relative to the frame, in the travel direction, the measurements of the position of the movable equipment being supplied to a processor unit; • a detection system for detecting contact occurring between the internal gauge and the container during movement of the movable equipment, occurrences of contact being supplied to the processor unit; • a detection system for detecting contact occurring between the external gauge and the container during movement of the movable equipment, occurrences of contact being supplied to the processor unit; and • a processor unit acting as a function of the measurements of the position of the movable equipment and of occurrences of contact between the gauges (14, 15) and the container to determine whether the rings and/or the necks of the containers have dimensions that are in compliance and to determine the types of defect for containers that are dimensionally not in compliance; • an emitter and receiver system for emitting and receiving a light beam in a direction parallel to the travel direction of the movable equipment and over a segment of length that is not less than the maximum stroke of the movable equipment, the emitter and receiver system being carried by the frame; and • a movement transformation mechanism (72, 73) carried by the movable equipment, for transforming the travel movement of the gauge (14, 15) relative to the movable equipment into a movement that obstructs or ceases to obstruct the light beam in order to detect the occurrence of contact with the gauge regardless of the position of the movable equipment.