Maya API: Place object(s) based in image

Hey guys, I was wondering if it’s possible through the Maya API to check the pixels of an image to find/define the position in worldspace? I’m pretty new to the API, so if there already exists examples of this it would be very much appreciated, or any tips or hints that can point me in the right direction :slight_smile:

Here’s an example (I want to place a locator in the center of each black square):

you might have to read the image using a separate image library, i would bring it into a array of 2d points to work with in the api, decide how you want to map it to world units, maybe 1pixel = 1 cm in maya, and run a if statemeant on each pixel.

if the pixel is a certain colour, move a object to those coordniates.

kinda abstract but the idea could be expanded apon to work

What passerby said. Take a look at PIL and OpenCV. I might look at the latter first since it was designed to do this kind of analysis quickly.

EDIT: Found another link, though you’ll have to convert to Python: opencv-code.com - opencv code Resources and Information.

Wow, OpenCV looks amazing!