1. A method of tracking a marker by an electronic device, the method comprising: acquiring a previous frame of a current frame and the current frame in an image having a marker that is a pattern representing predetermined information; detecting a position of a marker in the previous frame by detecting edges of the marker in the previous frame; tracking a position of the marker in the current frame based on the position of the marker detected in the previous frame; and estimating a 3D position based on the tracked position of the marker in the current frame to detect the predetermined information from the marker based on the 3D position.