With electroencephalography (EEG), a person’s brain activity can be monitored over time and sources of activity localized. With this information, brain regions showing pathological activity, such as epileptic spikes, can be delineated. In cases of severe drug-resistant epilepsy, surgical resection of these brain regions may be the only treatment option. This requires a precise localization of the responsible seizure generators. They can be reconstructed from EEG data when the electrode positions are known. The standard method employs a "digitization pen" and has severe drawbacks: It is time consuming, the result is user-dependent, and the patient has to hold still. We present a novel method which overcomes these drawbacks. It is based on the optical "Flying Triangulation" (FlyTri) sensor which allows a motion-robust acquisition of precise 3D data. To compare the two methods, the electrode positions were determined with each method for a real-sized head model with EEG electrodes and their deviation to the ground-truth data calculated. The standard deviation for the current method was 3.39 mm while it was 0.98 mm for the new method. The influence of these results on the final EEG source localization was investigated by simulating EEG data. The digitization pen result deviates substantially from the true source location and time series. In contrast, the FlyTri result agrees with the original information. Our findings suggest that FlyTri might become a valuable tool in the field of medical brain research, because of its improved precision and contactless handling. Future applications might include co-registration of multimodal information.