aiaiask.com©

开花即结果 提问即答案

基于OpenMV的Python程序:识别有色差图形并打印坐标及模型序号
原始问题:

基于OpenMV的Python程序:识别有色差图形并打印坐标及模型序号

以下是基于OpenMV的Python程序:

import OpenMV library

import openmv

Initialize camera and find the target with color difference

camera = openmv.mv()
img = camera.capture() # capture an image from the camera
blobs = img.find_blobs([(0, 0, 0), (255, 255, 255)], pixels_threshold=100, area_threshold=100) # find blobs of colors between black and white

# Print out the coordinates of each target found in the image and its order number
for blob in blobs:

x_coordinate = blob[0]   # get x coordinate of the target  

y_coordinate = blob[1]   # get y coordinate of the target  

print("The coordinates for this target are ({}, {}). This is target number {}".format(x_coordinate, y_coordinate, blobs.index(blob)+1))
基于OpenMV的Python程序:识别有色差图形并打印坐标及模型序号
https://www.aiaiask.com/ask/27483.html
AI / 模型DeepSeek
时间 / DATEMay 23, 2023, 6:57 PM
语言zh-CN
IP / 区域河南 郑州