An electronic device comprising: a memory; and at least one processor, coupled to the memory, configured to execute instructions, stored in the memory, to: obtain an image including a two-dimensional, 2D, color code (20, 50) in which a plurality of cells are located, the plurality of cells comprising base cells (21-24, 51-54), data cells and reference cells; detect outlines (40, 70) in the image including the 2D color code (20, 50); characterised in that the processor is further configured to execute the instructions to: based on a first shape of the base cells (21-24, 51-54), a color of the base cells (21-24, 51-54), and a second shape whose vertices are defined by the base cells (21-24, 51-54), detect candidates of the base cells (21-24, 51-54) among objects that are identified based on the detected outlines (40, 70); detect candidates of the reference cells based on a location of the candidates of the base cells (21-24, 51-54); determine a validity of the candidates of the base cells (21-24, 51-54) based on a color of the candidates of the reference cells and a color of the reference cells to detect the base cells (21-24, 51-54); detect the 2D color code (20, 50) in the image based on the detected base cells (21-24, 51-54) in the 2D color code (20, 50); and decode colors of the data cells included in the 2D color code (20, 50) to obtain data. a memory; and at least one processor, coupled to the memory, configured to execute instructions, stored in the memory, to: obtain an image including a two-dimensional, 2D, color code (20, 50) in which a plurality of cells are located, the plurality of cells comprising base cells (21-24, 51-54), data cells and reference cells; detect outlines (40, 70) in the image including the 2D color code (20, 50); characterised in that the processor is further configured to execute the instructions to: based on a first shape of the base cells (21-24, 51-54), a color of the base cells (21-24, 51-54), and a second shape whose vertices are defined by the base cells (21-24, 51-54), detect candidates of the base cells (21-24, 51-54) among objects that are identified based on the detected outlines (40, 70); detect candidates of the reference cells based on a location of the candidates of the base cells (21-24, 51-54); determine a validity of the candidates of the base cells (21-24, 51-54) based on a color of the candidates of the reference cells and a color of the reference cells to detect the base cells (21-24, 51-54); detect the 2D color code (20, 50) in the image based on the detected base cells (21-24, 51-54) in the 2D color code (20, 50); and decode colors of the data cells included in the 2D color code (20, 50) to obtain data. obtain an image including a two-dimensional, 2D, color code (20, 50) in which a plurality of cells are located, the plurality of cells comprising base cells (21-24, 51-54), data cells and reference cells; detect outlines (40, 70) in the image including the 2D color code (20, 50); characterised in that the processor is further configured to execute the instructions to: based on a first shape of the base cells (21-24, 51-54), a color of the base cells (21-24, 51-54), and a second shape whose vertices are defined by the base cells (21-24, 51-54), detect candidates of the base cells (21-24, 51-54) among objects that are identified based on the detected outlines (40, 70); detect candidates of the reference cells based on a location of the candidates of the base cells (21-24, 51-54); determine a validity of the candidates of the base cells (21-24, 51-54) based on a color of the candidates of the reference cells and a color of the reference cells to detect the base cells (21-24, 51-54); detect the 2D color code (20, 50) in the image based on the detected base cells (21-24, 51-54) in the 2D color code (20, 50); and decode colors of the data cells included in the 2D color code (20, 50) to obtain data. based on a first shape of the base cells (21-24, 51-54), a color of the base cells (21-24, 51-54), and a second shape whose vertices are defined by the base cells (21-24, 51-54), detect candidates of the base cells (21-24, 51-54) among objects that are identified based on the detected outlines (40, 70); detect candidates of the reference cells based on a location of the candidates of the base cells (21-24, 51-54); determine a validity of the candidates of the base cells (21-24, 51-54) based on a color of the candidates of the reference cells and a color of the reference cells to detect the base cells (21-24, 51-54); detect the 2D color code (20, 50) in the image based on the detected base cells (21-24, 51-54) in the 2D color code (20, 50); and decode colors of the data cells included in the 2D color code (20, 50) to obtain data.