The Bilateral Constant False Alarm Rate (BCFAR) detection algorithm calculates the spatial information of Synthetic Aperture Radar (SAR) image by the Gaussian kernel density estimator, and combines it with the intensity information of image to obtain the joint image for target detection. Compared with the classical CFAR detection algorithm which uses only intensity information for target detection, bilateral CFAR has better detection performance and robustness. However, with continuous high-intensity heterogeneous points (such as breakwater, azimuth ambiguity and phantom) in a complex environment, spatial information calculated by kernel density estimator will have more errors, which will lead to many false alarms in detection results. In addition, when it comes to a weak target with less similarity between adjacent pixels, it will miss detection. To effectively improve these problems, this paper designs an Improved Bilateral CFAR (IB-CFAR) algorithm in complex environment. The IB-CFAR proposed in this paper is mainly divided into three stages: intensity level division based on the nonuniform quantization method, intensity spatial domain information fusion and parameter estimation after clutter truncation. The intensity level division based on the nonuniform quantization method can improve the similarity and contrast information of weak targets, leading to improved ship detection rate. The information fusion of strength spatial domain is to fuse the spatial similarity, distance direction and strength information, which can further improve the detection rate and describe the ship structure information. Parameter estimation after clutter truncation can remove continuous high-intensity heterogeneous points in the background window and retain the real sea clutter samples to the maximum extent, which makes parameter estimation more accurate. Finally, according to the estimated parameters, an accurate sea clutter statistical model is established for CFAR detection. In this paper, the effectiveness and robustness of the proposed algorithm are verified by using GaoFen-3 and TerraSAR-X data.The experimental results show that the proposed algorithm performs well in the environment with more dense distribution of weak targets, and can obtain 97.85% detection rate and 3.52% false alarm rate in such environment. Compared with the existing detection algorithms, the detection rate increased by 5% and the false alarm rate reduced by 10%. However, when the number of weak targets is small and the background is very complex, few false alarms will appear.