Cloud and aerosol polarization imaging detector (CAPI) is one of the important payloads on the China Carbon Dioxide Observation Satellite (TANSAT), which can realize multispectral polarization detection and accurate on-orbit calibration. The main function of the instrument is to identify the interference of clouds and aerosols in the atmospheric detection path and to improve the retrieval accuracy of greenhouse gases. Therefore, it is of great significance to accurately identify the clouds in remote sensing images. However, in order to meet the requirement of lightweight design, CAPI is only equipped with channels in the near-ultraviolet to near-infrared bands. It is difficult to achieve effective cloud recognition using traditional visible light to thermal infrared band spectral threshold cloud detection algorithms. In order to solve the above problem, this paper innovatively proposes a cloud detection method based on different threshold tests from near ultraviolet to near infrared (NNDT). This algorithm first introduces the 0.38 μm band and the ratio of 0.38 μm band to 1.64 μm band, to realize the separation of cloud pixels and clear sky pixels, which can take advantage of the obvious difference in radiation characteristics between clouds and ground objects in the near-ultraviolet band and the advantages of the band ratio in identifying clouds on the snow surface. The experimental results show that the cloud recognition hit rate (PODcloud) reaches 0.94 (ocean), 0.98 (vegetation), 0.99 (desert), and 0.86 (polar), which therefore achieve the application standard of CAPI data cloud detection The research shows that the NNDT algorithm replaces the demand for thermal infrared bands for cloud detection, gets rid of the dependence on the minimum surface reflectance database that is embodied in traditional cloud recognition algorithms, and lays the foundation for aerosol and CO2 parameter inversion.