Various infectious agents are known to be transmitted naturally via respiratory aerosols produced by infected patients. Such aerosols may be produced during normal activities by breathing, talking, coughing and sneezing. The schlieren optical method, previously applied mostly in engineering and physics, can be effectively used here to visualize airflows around human subjects in such indoor situations, non-intrusively and without the need for either tracer gas or airborne particles. It accomplishes this by rendering visible the optical phase gradients owing to real-time changes in air temperature. In this study, schlieren video records are obtained of human volunteers coughing with and without wearing standard surgical and N95 masks. The object is to characterize the exhaled airflows and evaluate the effect of these commonly used masks on the fluid-dynamic mechanisms that spread infection by coughing. Further, a high-speed schlieren video of a single cough is analysed by a computerized method of tracking individual turbulent eddies, demonstrating the non-intrusive velocimetry of the expelled airflow. Results show that human coughing projects a rapid turbulent jet into the surrounding air, but that wearing a surgical or N95 mask thwarts this natural mechanism of transmitting airborne infection, either by blocking the formation of the jet (N95 mask), or by redirecting it in a less harmful direction (surgical mask).