We present a theoretical analysis of the optical matrix element between the electron and hole ground states in InAs/GaAs quantum dots (QDs) modeled with a truncated pyramidal shape. We use an eight-band k∙p Hamiltonian to calculate the QD electronic structure, including strain and piezoelectric effects. The ground state optical matrix element is very sensitive to variations in both the QD size and shape. For all shapes, the matrix element initially increases with increasing dot height, as the electron and hole wave functions become more localized in k space. Depending on the QD aspect ratio and on the degree of pyramidal truncation, the matrix element then reaches a maximum for some dot shapes at intermediate size beyond which it decreases abruptly in larger dots, where piezoelectric effects lead to a marked reduction in electron-hole overlap.