This invention relates to method of generating a three dimensional surface profile of a food object, where the food object is exposed with a conical X-ray beam while the food object is conveyed. The attenuation of the X-rays after penetrating through the food object is detected, the detection being performed using a plurality of sensors arranged below the food object, the plurality of sensors being positioned at a pre-determined angular positions in relation to the X-ray source. For each of the plurality of sensors, the detected attenuation is converted into a penetration length of the X-ray beam, the penetration length indicating the length from where the X-ray beam enters and leaves the food object, and surface coordinates are sequentially determined using the penetration lengths and the angular positions as input data.