the process proceeds to step 28 and one of the extrema is selected a plurality of focus extrema may arise for example when dust particles on an outer surface of the sample conduit 10 an air bubble on an inner surface of the sample conduit 10 and possibly a scratch on a opposed outer surface form additional image planes with high contrast features in addition to an image plane containing the objects 14 in the sample 12 flowing in the sample conduit 10 only the latter is the plane in which the focus should be placed this plane can be distinguished from the others in that the objects in question flowing in the sample are moving therefore the desired object plane can be identified on the basis of the velocity of the objects in which the focus measures were calculated accordingly at step 28 object velocity is calculated from the frames associated with each pair of focus values focus measure ways of calculating object velocities of objects in captured images are well known for example for an object detected in a first frame it is checked whether there is a single object within a detection radius from the position of the object in the first frame in the next frame if so these objects are taken to correspond to the same physical object and a velocity is calculated using the difference between the object positions in the two frames and the sample rate if more than one object is detected in the radius in the subsequent frame the calculation for that object is aborted an overall object velocity is then determined by averaging individual.