An electronic device comprising: a camera configured to capture an outside image of a vehicle; a memory storing one or more instructions; and a processor configured to execute the one or more instructions stored in the memory, wherein the processor executes the one or more instructions to: determine, from the captured image, a driving center line of the vehicle; determine, from the captured image, at least one object for estimating lane information, wherein the at least one object includes a first front vehicle located on the driving center line and the lane information comprises lines that divide a road on which the vehicle is driving along lanes; determine a road area from the captured image; acquire information about the number of lanes of the road on which the vehicle is driving, based on position information of the vehicle; estimate a first lane width of a first lane on which the vehicle is driving from the captured image, based on a distance between the first front vehicle and the vehicle and the vehicle width of the first front vehicle; divide the road area by the acquired number of lanes by using a vanishing point of the image as a pivot and the estimated first lane width to estimate the lane information of the road; and output guide information for guiding driving of the vehicle based on the estimated lane information. a camera configured to capture an outside image of a vehicle; a memory storing one or more instructions; and a processor configured to execute the one or more instructions stored in the memory, wherein the processor executes the one or more instructions to: determine, from the captured image, a driving center line of the vehicle; determine, from the captured image, at least one object for estimating lane information, wherein the at least one object includes a first front vehicle located on the driving center line and the lane information comprises lines that divide a road on which the vehicle is driving along lanes; determine a road area from the captured image; acquire information about the number of lanes of the road on which the vehicle is driving, based on position information of the vehicle; estimate a first lane width of a first lane on which the vehicle is driving from the captured image, based on a distance between the first front vehicle and the vehicle and the vehicle width of the first front vehicle; divide the road area by the acquired number of lanes by using a vanishing point of the image as a pivot and the estimated first lane width to estimate the lane information of the road; and output guide information for guiding driving of the vehicle based on the estimated lane information. determine, from the captured image, a driving center line of the vehicle; determine, from the captured image, at least one object for estimating lane information, wherein the at least one object includes a first front vehicle located on the driving center line and the lane information comprises lines that divide a road on which the vehicle is driving along lanes; determine a road area from the captured image; acquire information about the number of lanes of the road on which the vehicle is driving, based on position information of the vehicle; estimate a first lane width of a first lane on which the vehicle is driving from the captured image, based on a distance between the first front vehicle and the vehicle and the vehicle width of the first front vehicle; divide the road area by the acquired number of lanes by using a vanishing point of the image as a pivot and the estimated first lane width to estimate the lane information of the road; and output guide information for guiding driving of the vehicle based on the estimated lane information.