In close-range photogrammetry, circular-coded targets (CCTs) are a reliable method to solve the issue of image correspondence. Currently, the identification methods for CCTs are very mature, but complex illumination conditions are still a key factor restricting identification. This article proposes an adaptive homomorphic filtering (AHF) algorithm to solve this issue, utilizing homomorphic filtering (HF) to eliminate the influence of uneven illumination. However, HF parameters vary with different lighting types. We use a genetic algorithm (GA) to carry out global optimization and take the identification result as the objective function to realize automatic parameter adjustment. This is different from the optimization strategy of traditional adaptive image enhancement methods, so the most significant advantage of the proposed algorithm lies in its automation and universality, i.e., users only need to input photos without considering the type of lighting conditions. As a preprocessing algorithm, we conducted experiments combining advanced commercial photogrammetric software and traditional identification methods, respectively. We cast stripe- and lattice-structured light to create complex lighting conditions, including uneven lighting, dense shadow areas, and elliptical light spots. Experiments showed that our algorithm significantly improves the robustness and accuracy of CCT identification methods under complex lighting conditions. Given the perfect performance under stripe-structured light, this algorithm can provide a new idea for the fusion of close-range photogrammetry and structured light. This algorithm helps to improve the quality and accuracy of photogrammetry and even helps to improve the decision making and planning process of photogrammetry.