Intra-pixel sensitivity variations (IPSVs) in charge-coupled devices (CCDs) and complementary metal-oxide-semiconductor detectors constitute a significant source of astrometric error for undersampled stellar observations. Since laboratory-based IPSV measurements suffer from limited applicability, we propose a computational method to directly infer IPSV from stellar images and validate it with simulated data. By minimizing the flux residuals between theoretical and observed stellar models through least-squares fitting, we can successfully recover the IPSV, which is treated as nearly identical across pixels. Simulations demonstrate that the reconstructed IPSV achieves high accuracy, and the instrumental point spread function (IPSF) restored using this IPSV improves stellar centroiding by nearly 30×, effectively eliminating periodic pixel-phase errors. The method remains robust under different morphologies of IPSV and varying sampling conditions. Additionally, the framework can be extended to an iterative IPSF-IPSV closed-loop scheme that updates both components simultaneously, providing a practical pathway for continuous detector calibration in future space-based astronomical surveys.