Background oriented schlieren (BOS) is a non-intrusive optical method for measuring density gradients in a fluid flow based on variations of the local refractive index. The type of BOS optical system used, i.e., entocentric vs. telecentric, and the system design determine the accuracy and quality of the measurement. This work aims to optimize both types of optical systems to minimize the error for measurements of high-speed compressible turbulent boundary layers. Claims of the advantages offered by telecentric optical systems over entocentric systems are investigated, as well as the out-of-focus effects for types of systems. Numerical ray tracing simulations are performed using density fields from large eddy simulations (LES) of a Mach 2 turbulent boundary layer to generate synthetic but realistic BOS images. The results show that telecentric systems have lower overall error and less sensitivity. Contrary to recommendations by early BOS work, the best accuracy is achieved when density gradient object is placed outside of the depth of field of the optical system, for both entocentric and telecentric systems.