This paper proposes a robust and lightweight visual localization framework for UAVs in GNSS-denied environments. Utilizing a Variational Autoencoder (VAE) trained on full RGB imagery, the system extracts rich features compressed into an optimized 256-dimensional latent space to accommodate onboard constraints. These features are matched using an unnormalized Euclidean distance, while a Linear Kalman Filter (LKF) smooths the trajectory. Experiments demonstrate this model outperforms baselines, achieving a raw RMSE of 0.087 m, which improves to 0.065 m with the LKF. This approach ensures stable, highly accurate real-time navigation.