To accurately determine whether an image has been tampered, a robust digital watermarking algorithm based on the frequency domain was proposed. Watermarks will be embedded in the middle frequency domain of the coefficient matrix, and combining with the JPEG luminance quantization table, better balance will be achieved between the watermark transparency and the robustness of the algorithm. Moreover, before being embedded in the host image, the watermark information is encoded using the chaotic sequence, to improve the security of the algorithm. Experiment results showed that, the watermarked image generated by the proposed algorithm has higher quality. When suffering JPEG compression, cropping and other tampering attacks, the image authenticity can be determined by the similarity between the extracted watermarking and the original watermarking.