An electronic device provided in an autonomous vehicle , the electronic device 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 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 and having a width half of the width of the bounding box , i) divide the bounding box into a first area positioned left based on a middle position of the bounding box , and a second area positioned right based on the middle position of the bounding box , 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 , wherein pixel values in extended portions of the extended bounding box are corresponding to an average value of all pixel values included in the bounding box , 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 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 and having a width half of the width of the bounding box , i) divide the bounding box into a first area positioned left based on a middle position of the bounding box , and a second area positioned right based on the middle position of the bounding box , 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 , wherein pixel values in extended portions of the extended bounding box are corresponding to an average value of all pixel values included in the bounding box , 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. <EOS>