A digital slide scanning apparatus comprising: a focusing sensor (615, 620); an imaging sensor (615, 620); a main processor configured to control a scanning stage configured to support a sample and move the sample relative to the focusing sensor and the imaging sensor, and generate image data from the focusing sensor and the imaging sensor; and a secondary processor configured to: process the generated image data, for each of: i) a focus buffer comprising a plurality of scan lines generated by the focusing sensor, and ii) an image buffer comprising a plurality of scan lines generated by the imaging sensor, wherein each of the plurality of scan lines comprises a plurality of pixels: access the respective buffer, calculate an average contrast value for each pixel column in the plurality of scan lines of the respective buffer, wherein a pixel column comprises all of the pixels at a respective location across all of the plurality of scan lines in the respective buffer, and generate a respective contrast vector for the respective buffer, wherein the respective contrast vector comprises the average contrast value for each pixel column in the plurality of scan lines in the respective buffer, and return both a first contrast vector, generated from the focus buffer, and a second contrast vector, generated from the image buffer, to the main processor for further processing. a focusing sensor (615, 620); an imaging sensor (615, 620); a main processor configured to control a scanning stage configured to support a sample and move the sample relative to the focusing sensor and the imaging sensor, and generate image data from the focusing sensor and the imaging sensor; and control a scanning stage configured to support a sample and move the sample relative to the focusing sensor and the imaging sensor, and generate image data from the focusing sensor and the imaging sensor; and a secondary processor configured to: process the generated image data, for each of: i) a focus buffer comprising a plurality of scan lines generated by the focusing sensor, and ii) an image buffer comprising a plurality of scan lines generated by the imaging sensor, wherein each of the plurality of scan lines comprises a plurality of pixels: access the respective buffer, calculate an average contrast value for each pixel column in the plurality of scan lines of the respective buffer, wherein a pixel column comprises all of the pixels at a respective location across all of the plurality of scan lines in the respective buffer, and generate a respective contrast vector for the respective buffer, wherein the respective contrast vector comprises the average contrast value for each pixel column in the plurality of scan lines in the respective buffer, and return both a first contrast vector, generated from the focus buffer, and a second contrast vector, generated from the image buffer, to the main processor for further processing. process the generated image data, for each of: i) a focus buffer comprising a plurality of scan lines generated by the focusing sensor, and ii) an image buffer comprising a plurality of scan lines generated by the imaging sensor, wherein each of the plurality of scan lines comprises a plurality of pixels: access the respective buffer, calculate an average contrast value for each pixel column in the plurality of scan lines of the respective buffer, wherein a pixel column comprises all of the pixels at a respective location across all of the plurality of scan lines in the respective buffer, and generate a respective contrast vector for the respective buffer, access the respective buffer, calculate an average contrast value for each pixel column in the plurality of scan lines of the respective buffer, wherein a pixel column comprises all of the pixels at a respective location across all of the plurality of scan lines in the respective buffer, and generate a respective contrast vector for the respective buffer, wherein the respective contrast vector comprises the average contrast value for each pixel column in the plurality of scan lines in the respective buffer, and return both a first contrast vector, generated from the focus buffer, and a second contrast vector, generated from the image buffer, to the main processor for further processing.