The invention discloses an automatic control method and device of a camera head, is applied to the technical field of image collection, and is used for solving the stable imaging problems of the bayonet system and the like to a characteristic target area in the intelligent traffic field. The method comprises the steps as follows: setting the initial range values of the background brightness, the foreground target brightness and the object brightness according to experience or scene requirements; extracting the foreground target in the region to be detected, and calculating the brightness value of the foreground target; locating the target in the region to be detected by adopting the target location technology, and calculating the brightness value of the target; detecting the target area and panoramic picture according to the brightness value of the foreground target, and calculating the background brightness value; and obtaining a camera head control coefficient according to the foreground target brightness value, the background brightness value and the target brightness value, and selecting a camera control mode and a brightness control mode to control the automatic exposure and gain of the camera head. According to the embodiment of the invention, the target in the region to be determined can be clearly and effectively imaged, and the visual effect of the panorama is simultaneously considered.