High-resolution, pixelated LED arrays allow flexible illumination. By addressing certain areas of the LED matrix and projecting the emitted light, selective illumination can be achieved. When combined with computer vision, smart, autonomous lighting systems are within reach. However, limitations of the used projection optics, in combination with the fact that the LED array and camera can be at a different position, severely complicates the problem of calculating which LED pixels to address in order to achieve a desired target pattern. This work proposes a least-squares deconvolution-based calculation method to solve this problem. The method relies on an initial calibration step that characterizes the complete point-spread-function of the LED array for the considered illumination configuration. This allows using the system for various settings. The method is experimentally validated for an off-axis illumination configuration that demonstrates the accuracy and flexibility of the approach. Because the proposed algorithm is fast and guarantees a global optimum, it opens new avenues towards accurate, smart and adaptive illumination.