Method for directing a movable unloading apparatus of an agricultural harvesting machine to a container driven adjacent the harvesting machine, the container comprising, as seen from the harvesting machine, near and remote upper borders (6,8), the method comprising the steps of: using a camera on the harvesting machine for capturing images of at least a portion of the container, the camera generating image data containing data on the distance between the camera and the portion of the container; processing the image data for deriving therefrom data on the relative position between the portion of the container and the unloading apparatus; and using the relative position data for automatically moving the unloading apparatus relative to the harvesting machine towards a predetermined position relative to the container, characterised in that the step of processing the image data comprises: - selecting from the captured image the image data pertaining to a vertical strip (21/22) on the left and/or right hand side of the unloading apparatus; - for the or each vertical strip filtering the distance data for each vertical position to generate a single filtered distance value for that vertical position; and - for the or each strip analysing the sequence of filtered distance values for deriving therefrom the vertical position of the near and/or remote upper border (6 8) of the container; and wherein the predetermined relative position is a position wherein the unloading apparatus directs the harvested crop to a position above said near upper border and/or below said remote upper border, respectively. using a camera on the harvesting machine for capturing images of at least a portion of the container, the camera generating image data containing data on the distance between the camera and the portion of the container; processing the image data for deriving therefrom data on the relative position between the portion of the container and the unloading apparatus; and using the relative position data for automatically moving the unloading apparatus relative to the harvesting machine towards a predetermined position relative to the container, the step of processing the image data comprises: - selecting from the captured image the image data pertaining to a vertical strip (21/22) on the left and/or right hand side of the unloading apparatus; - for the or each vertical strip filtering the distance data for each vertical position to generate a single filtered distance value for that vertical position; and - for the or each strip analysing the sequence of filtered distance values for deriving therefrom the vertical position of the near and/or remote upper border (6 8) of the container; and wherein the predetermined relative position is a position wherein the unloading apparatus directs the harvested crop to a position above said near upper border and/or below said remote upper border, respectively. - selecting from the captured image the image data pertaining to a vertical strip (21/22) on the left and/or right hand side of the unloading apparatus; - for the or each vertical strip filtering the distance data for each vertical position to generate a single filtered distance value for that vertical position; and - for the or each strip analysing the sequence of filtered distance values for deriving therefrom the vertical position of the near and/or remote upper border (6 8) of the container; and