1. A method of machine vision, the method comprising: identifying contours of fruits in a first image and a second image; performing two-way matching of contours to identify pairs of matched contours, each pair comprising a respective first contour in the first image that matches a respective second contour in the second image; for each pair of matched contours, identifying a respective affine transformation that transforms points in the respective second contour to points in the respective first contour; mapping the second image to the first image using the affine transformations to form a composite image; and counting fruits in the composite image.