An electronic device (100, 310, 320) provided in an autonomous vehicle, the electronic device (100, 310, 320) comprising: a) a camera; b) a memory storing at least one instruction; and c) at least one processor operatively coupled with the camera; d) wherein the at least one processor is configured to, when the instructions are executed: e) obtain a front image in which the autonomous vehicle is driving through the camera, f) identify a target vehicle in the front image based on the vehicle detection model stored in the memory, g) generate a bounding box (510, 520, 540) corresponding to the target vehicle in response to an identification of the target vehicle, h) generate a sliding window having a height equal to the height of the bounding box (510, 520, 540) and having a width half of the width of the bounding box (510, 520, 540), i) divide the bounding box (510, 520, 540) into a first area positioned left based on a middle position of the bounding box (510, 520, 540), and a second area positioned right based on the middle position of the bounding box (510, 520, 540), j) generate an extended bounding box by extending the first area in a left direction and extending the second area in a right direction, wherein size of the extended bounding box is twice as wide as size of the bounding box (510, 520, 540), wherein pixel values in extended portions (542, 545) of the extended bounding box are corresponding to an average value of all pixel values included in the bounding box (510, 520, 540), k) obtain a sum of a pixel difference values between a left portion of the sliding window and a right portion of the sliding window for each shift by sequentially shifting the sliding window by a predefined pixel interval with respect to all of width of the extended bounding box, wherein the right portion of the sliding window is inverted left and right while obtaining the sum of the pixel difference values for each of sequentially shifted sliding windows, and l) identify a point that corresponds to a minimum value among sum values respectively indicating the sums that are obtained according to the shifting. a) a camera; b) a memory storing at least one instruction; and c) at least one processor operatively coupled with the camera; d) wherein the at least one processor is configured to, when the instructions are executed: e) obtain a front image in which the autonomous vehicle is driving through the camera, f) identify a target vehicle in the front image based on the vehicle detection model stored in the memory, g) generate a bounding box (510, 520, 540) corresponding to the target vehicle in response to an identification of the target vehicle, h) generate a sliding window having a height equal to the height of the bounding box (510, 520, 540) and having a width half of the width of the bounding box (510, 520, 540), i) divide the bounding box (510, 520, 540) into a first area positioned left based on a middle position of the bounding box (510, 520, 540), and a second area positioned right based on the middle position of the bounding box (510, 520, 540), j) generate an extended bounding box by extending the first area in a left direction and extending the second area in a right direction, wherein size of the extended bounding box is twice as wide as size of the bounding box (510, 520, 540), wherein pixel values in extended portions (542, 545) of the extended bounding box are corresponding to an average value of all pixel values included in the bounding box (510, 520, 540), k) obtain a sum of a pixel difference values between a left portion of the sliding window and a right portion of the sliding window for each shift by sequentially shifting the sliding window by a predefined pixel interval with respect to all of width of the extended bounding box, wherein the right portion of the sliding window is inverted left and right while obtaining the sum of the pixel difference values for each of sequentially shifted sliding windows, and l) identify a point that corresponds to a minimum value among sum values respectively indicating the sums that are obtained according to the shifting.