# Coordinates of specific color in video

**URL:** <https://forum.opencv.org/t/coordinates-of-specific-color-in-video/11494>\
**Category:** Python\
**Created:** [January 4, 2023, 10:06pm UTC](https://forum.opencv.org/t/coordinates-of-specific-color-in-video/11494 "2023-01-04T22:06:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick717](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@patrick717](https://forum.opencv.org/u/patrick717)\
**Post date:** [January 4, 2023, 10:06pm UTC](https://forum.opencv.org/t/coordinates-of-specific-color-in-video/11494/1 "2023-01-04T22:06:02Z")

</div>

I would like to know, how print results, where coordinates of a specific color is matched.

F.e. I have a blue color (BGR defined lower) and when run a webcam, I would like to see, where in the coordinate system it is detected as this color. How to print such a results? Thank you.

I use following:

```auto

import numpy as np
import cv2

lower = np.array([90, 50, 50])
upper = np.array([130, 255, 255])

video = cv2.VideoCapture(0)

while True:
    success, img = video.read()
    image = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
    mask = cv2.inRange(image, lower, upper)
    
    cv2.imshow("mask", mask)
    cv2.imshow("webcam", img)
    
    if cv2.waitKey(1) == ord('q'):
        break
        
cap.release()
cv.destroyAllWindows()

```

---

<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:** [January 5, 2023, 8:44am UTC](https://forum.opencv.org/t/coordinates-of-specific-color-in-video/11494/2 "2023-01-05T08:44:13Z")

</div>

you can use [findNonZero()](https://docs.opencv.org/4.x/d2/de8/group __core__ array.html#gaed7df59a3539b4cc0fe5c9c8d7586190) to retrieve the positions of the white pixels in the mask
