A sensor device for quantifying luminescent targets, wherein the device comprises: - a light source for exciting the luminescent targets, thus generating luminescence signals, - a detector adapted for observing a surface or a three dimensional volume wherein the surface or the three dimensional volume is subdivided in a number of observed cells, by detecting the luminescence signals of the luminescent targets in each of the observed cells, resulting in detected signals which comprise, for a concerned cell of the observed cells, a desired signal originating from the luminescent targets in the concerned cell and a background signal, wherein: - the sensor device comprises an evanescent field generating structure, wherein the light source is coupled to the evanescent field generating structure and wherein the evanescent field generating structure is adapted for generating an evanescent field at the surface or in the three dimensional volume wherein the surface or the three dimensional volume comprises affinity probes for binding the luminescent targets, - wherein the detector has a spatial cell resolution and/or a time resolution that is so high such that a change in the discrete number of luminescent targets in the concerned cell, when bound to the affinity probes, results in an observable change in the detected signal from the concerned cell, characterized by - a processor configured to distinguish the desired signal from the background signal by applying data analysis on the detected signal to reduce the uncertainty on the background signal until a signal is obtained which changes in discretely discernible steps corresponding to the number of binding events in the concerned cell, and to combine the detected signals of the observed cells and/or different moments in time, so as to quantify the luminescent targets. - a light source for exciting the luminescent targets, thus generating luminescence signals, - a detector adapted for observing a surface or a three dimensional volume wherein the surface or the three dimensional volume is subdivided in a number of observed cells, by detecting the luminescence signals of the luminescent targets in each of the observed cells, resulting in detected signals which comprise, for a concerned cell of the observed cells, a desired signal originating from the luminescent targets in the concerned cell and a background signal, wherein: - the sensor device comprises an evanescent field generating structure, wherein the light source is coupled to the evanescent field generating structure and wherein the evanescent field generating structure is adapted for generating an evanescent field at the surface or in the three dimensional volume wherein the surface or the three dimensional volume comprises affinity probes for binding the luminescent targets, - wherein the detector has a spatial cell resolution and/or a time resolution that is so high such that a change in the discrete number of luminescent targets in the concerned cell, when bound to the affinity probes, results in an observable change in the detected signal from the concerned cell, characterized by - a processor configured to distinguish the desired signal from the background signal by applying data analysis on the detected signal to reduce the uncertainty on the background signal until a signal is obtained which changes in discretely discernible steps corresponding to the number of binding events in the concerned cell, and to combine the detected signals of the observed cells and/or different moments in time, so as to quantify the luminescent targets.