在图像中查找颜色的x,y坐标。节点JS

时间:2021-12-23 21:21:58

I would like to capture whole screen and then get the coordinates(x, y) of color which i provide. So i can click that coordinate with RobotJS.

我想捕捉整个屏幕,然后得到我提供的颜色坐标(x,y)。所以我可以用RobotJS点击那个坐标。

1 个解决方案

#1


0  

A little bit more detail about your setup would be necessary. Since you tagged it, I guess you have access to OpenCV in your project? With OpenCV you can use 'inrange' to filter the channels of your image based on the color, which will give you a binary mask. You can use the mask to find blobs and their central points in your image, where the color predominates with connectedComponents or findContours.

关于您的设置的更多细节将是必要的。既然你标记了它,我想你可以在你的项目中访问OpenCV吗?使用OpenCV,您可以使用“inrange”根据颜色过滤图像的通道,这将为您提供二进制掩码。您可以使用蒙版在图像中查找斑点及其中心点,其中颜色以connectedComponents或findContours为主。

#1


0  

A little bit more detail about your setup would be necessary. Since you tagged it, I guess you have access to OpenCV in your project? With OpenCV you can use 'inrange' to filter the channels of your image based on the color, which will give you a binary mask. You can use the mask to find blobs and their central points in your image, where the color predominates with connectedComponents or findContours.

关于您的设置的更多细节将是必要的。既然你标记了它,我想你可以在你的项目中访问OpenCV吗?使用OpenCV,您可以使用“inrange”根据颜色过滤图像的通道,这将为您提供二进制掩码。您可以使用蒙版在图像中查找斑点及其中心点,其中颜色以connectedComponents或findContours为主。