Optical contamination due to wall reflection creates limitations for near-wall velocity field measurement via either particle image velocimetry (PIV) or particle tracking velocimetry (PTV). In this paper, a simple image pre-processing method, i.e. the ratio cut method, is proposed to deal with this problem. It is based on the ratio between the grayscale intensities of tracer particles and those of the laser-illuminated background, on which a direct minimum cut is applied on the basis of a non-dimensional threshold for background removal. To evaluate its performance in near-wall measurement, this ratio cut method, along with two other typical pre-processing methods, i.e. the minimum removal method and the proper orthogonal decomposition (POD) filtering method, are applied to particle images in the near-wall region of turbulent boundary layers over an opaque roughness wall (ORW), whose characteristic roughness height is small enough to be regarded as hydraulically smooth, but still gives rise to severe wall reflection. Results for a case involving a transparent smooth wall, which suffers less from wall reflection issues, and direct numerical simulation (DNS) data at a similar Reynolds number are employed as reference baselines for performance evaluation. The examination of pre-processed particle images, as well as the probability density function (PDF) of grayscale intensities, indicates that the ratio cut method is capable of eliminating time-dependent flare, reducing noise level, and retaining low-intensity particles in the ORW case. These features are almost completely absent in both the minimum removal method and the POD filtering method. In addition, PTV-obtained velocity statistics for an ORW, pre-processed by the ratio cut method, including data relating to fluctuating intensity and the PDF distribution of fluctuating velocity, are shown to be more consistent with those relating to baseline cases than data obtained by either of the the other two methods used for comparison. Moreover, evidence is also provided regarding the superiority and robustness of this approach, in terms of estimating the mean skin friction from the near-all mean velocity profile.