A washing machine for setting functions based on object sensing, comprising: a washing function unit comprising a tub, a drum and a motor, and configured to perform physical and electrical functions for storing and washing laundry; a distance sensor configured to produce information on a distance to the laundry in the tub from the distance sensor , the distance indicating a height of the laundry in the tub, wherein the distance sensor is disposed at an upper portion or a lateral surface of the washing function unit ; an image sensor configured to obtain information on an image of the laundry, wherein said information on the image of the laundry comprises information on colors or grayscale contrast of the image of the laundry and the image sensor is disposed at an upper portion or a lateral surface of the washing function unit ; a measuring unit configured to measure at least one of weight of the laundry, physical information and electrical information generated during a wash, wherein said physical information comprises at least one of washing time, a rotation speed of the drum, eccentricity of laundry load, and intensity of vibration, and wherein the electrical information comprises a voltage of the motor or a current of the motor; and a control unit configured to control the washing function unit on the basis of information on course setting produced by a learning unit in the washing machine in accordance with information on the distance obtained by the distance sensor , information on the image of the laundry obtained by the image sensor , information on the at least one measurement obtained by the measuring unit , wherein the learning unit is configured to perform learning a number of times using information on the distance to the laundry in the tub from the distance sensor , images of the laundry and measurements that were produced during earlier washes as an input factor and information on course setting that were set during these earlier washes as an output factor. a washing function unit comprising a tub, a drum and a motor, and configured to perform physical and electrical functions for storing and washing laundry; a distance sensor configured to produce information on a distance to the laundry in the tub from the distance sensor , the distance indicating a height of the laundry in the tub, wherein the distance sensor is disposed at an upper portion or a lateral surface of the washing function unit ; an image sensor configured to obtain information on an image of the laundry, wherein said information on the image of the laundry comprises information on colors or grayscale contrast of the image of the laundry and the image sensor is disposed at an upper portion or a lateral surface of the washing function unit ; a measuring unit configured to measure at least one of weight of the laundry, physical information and electrical information generated during a wash, wherein said physical information comprises at least one of washing time, a rotation speed of the drum, eccentricity of laundry load, and intensity of vibration, and wherein the electrical information comprises a voltage of the motor or a current of the motor; and a control unit configured to control the washing function unit on the basis of information on course setting produced by a learning unit in the washing machine in accordance with information on the distance obtained by the distance sensor , information on the image of the laundry obtained by the image sensor , information on the at least one measurement obtained by the measuring unit , wherein the learning unit is configured to perform learning a number of times using information on the distance to the laundry in the tub from the distance sensor , images of the laundry and measurements that were produced during earlier washes as an input factor and information on course setting that were set during these earlier washes as an output factor. <EOS>