# Need location of detected image, Raspberry pi

**URL:** <https://forum.opencv.org/t/need-location-of-detected-image-raspberry-pi/16423>\
**Category:** Uncategorized\
**Tags:** raspberrypi, programming\
**Created:** [February 10, 2024, 1:09am UTC](https://forum.opencv.org/t/need-location-of-detected-image-raspberry-pi/16423 "2024-02-10T01:09:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![charleslinquist](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@charleslinquist](https://forum.opencv.org/u/charleslinquist)\
**Post date:** [February 10, 2024, 1:09am UTC](https://forum.opencv.org/t/need-location-of-detected-image-raspberry-pi/16423/1 "2024-02-10T01:09:36Z")

</div>

Is there a way to get an X,Y output of the center of any detected image? A number that is output on a pin in serial format? Something like an X, Y, size and confidence level?

I’m trying to do a “follow me” application where the output will be used to control motors to follow someone.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [February 10, 2024, 6:27am UTC](https://forum.opencv.org/t/need-location-of-detected-image-raspberry-pi/16423/2 "2024-02-10T06:27:42Z")

</div>

object detection networks (e.g. YOLO) will give you a bounding box & confidence values _in the 2d image plane (pixels)_

please, care to explain, what you mean with ‘location’ exactly ?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [February 10, 2024, 11:15am UTC](https://forum.opencv.org/t/need-location-of-detected-image-raspberry-pi/16423/3 "2024-02-10T11:15:33Z")

</div>

> [@charleslinquist](#):
>
> A number that is output on a pin in serial format?

that is purely a programming issue. it’s not related to OpenCV.

please clarify your question.

---

<div class="post-metadata">

**Author:** ![charleslinquist](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@charleslinquist](https://forum.opencv.org/u/charleslinquist)\
**Post date:** [February 10, 2024, 3:01pm UTC](https://forum.opencv.org/t/need-location-of-detected-image-raspberry-pi/16423/4 "2024-02-10T15:01:06Z")

</div>

Yes, in serial format. I’m a novice, but all the applications I have seen with OpenCV show a detected object on a screen and - at most, indicate whether the object is detected or not, or which person is detected. My first application is to put a camera on the top of a monitor. I would have previously stored a series of 40 or so still images of (say) my face taken from various angles. When a person walked by the monitor, they would be detected and the appropriate stored image would be selected and displayed. That way, my image on the monitor would follow the person as they walked by. It would always be looking straight at them regardless of where they were. If they ducked, the person on the monitor would look down, etc. For future uses, it would also be useful to have some sort of an idea of how far away an object was, based on the image size of common objects. This would also help when two or more people walked by, since the closest person would be the only one followed.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [February 10, 2024, 5:05pm UTC](https://forum.opencv.org/t/need-location-of-detected-image-raspberry-pi/16423/5 "2024-02-10T17:05:57Z")

</div>

> [@charleslinquist](#):
>
> It would always be looking straight at them regardless of where they were

portraits where the eyes follow you are a known illusion. you don’t need to do anything dynamic to do that.
