# Marker position on screen

**URL:** https://discourse.processing.org/t/marker-position-on-screen/10871
**Category:** Project Guidance
**Created:** [May 3, 2019, 9:53am UTC](https://discourse.processing.org/t/marker-position-on-screen/10871 "2019-05-03T09:53:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sandermoonen](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sandermoonen](https://discourse.processing.org/u/sandermoonen)
#### Post date: [May 3, 2019, 9:53am UTC](https://discourse.processing.org/t/marker-position-on-screen/10871/1 "2019-05-03T09:53:23Z")

</div>

Hi there! I’m working on a project for my studies and am in need to find a way to detect the position of a certain marker (QR/Aruco/whatever) in the field of my webcam. It doesn’t need to be super specific, but I basically need to know if it’s in the left, middle or right of the screen so I can send that to an Arduino. I’ve tried nyartoolkit, but I can’t seem to make that work. Any suggestions?

Thanks!

---

<div class="post-metadata">

### Author: ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)
#### Post date: [May 3, 2019, 8:08pm UTC](https://discourse.processing.org/t/marker-position-on-screen/10871/2 "2019-05-03T20:08:04Z")

</div>

Hi,

You can try to have a look at the OpenCV library:

> **[atduskgreg/opencv-processing](https://github.com/atduskgreg/opencv-processing)**
>
> OpenCV for Processing. A creative coding computer vision library based on the official OpenCV Java API - atduskgreg/opencv-processing

You should be able to find plenty of useful information here and on the web.

Or you could also code it yourself. I don’t know the kind of images that you are dealing with but it can be quite easy to code something with a combination of threshold and flood fill algorithm that gives you good result.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [May 4, 2019, 3:52pm UTC](https://discourse.processing.org/t/marker-position-on-screen/10871/3 "2019-05-04T15:52:49Z")

</div>

What kind of marker? Fiducial / QRCode, or spot color, or …?

In addition to OpenCV, BoofCV is another common library for fiducial tracking:

> <https://github.com/lessthanoptimal/BoofProcessing/blob/master/examples/Fiducials/Fiducials.pde>

---

<div class="post-metadata">

### Author: ![sandermoonen](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sandermoonen](https://discourse.processing.org/u/sandermoonen)
#### Post date: [May 8, 2019, 2:44pm UTC](https://discourse.processing.org/t/marker-position-on-screen/10871/4 "2019-05-08T14:44:51Z")

</div>

Thanks so much, I’ve been using the BoofCV and it works great! I’ve got the code where you can track a marker and it prints the location of the image on the screen in the console.
