In some special applications,CCD cameras may face kinds of different and changing scenes,so automatic exposure becomes to be a key problem in research.An effective automatic exposure algorithm based on image histogram is proposed in this paper.Firstly,it needs to analyze the luminance distribution of one frame image and account the optimal mean of the next image.Then,the exposure value(EV) will be adjusted based on the optimal mean to gain a rational exposure.The experimental results show that images obtained by the proposed algorithm present appropriate brightness,proving that the algorithm not only has a good capability to adapt to various scenes,but also it can meet the requirement of automatic exposure of CCD cameras.