mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
update color and encode
This commit is contained in:
parent
41bcdf870b
commit
f34f0b1a5a
2 changed files with 2 additions and 5 deletions
|
|
@ -16,7 +16,7 @@ __version__ = "1.0"
|
|||
|
||||
class Object_detect(Movement):
|
||||
|
||||
def __init__(self, camera_x = 155, camera_y = 10):
|
||||
def __init__(self, camera_x = 155, camera_y = 15):
|
||||
# inherit the parent class
|
||||
super(Object_detect, self).__init__()
|
||||
# declare mycobot280
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ class Detect_marker(Movement):
|
|||
else:
|
||||
self.cache_x = self.cache_y = 0
|
||||
# 调整吸泵吸取位置,y增大,向左移动;y减小,向右移动;x增大,前方移动;x减小,向后方移动
|
||||
self.move(x, y+160, color)
|
||||
self.move(x-15, y+145, color)
|
||||
|
||||
# init mycobot
|
||||
def init_mycobot(self):
|
||||
|
|
@ -214,9 +214,6 @@ class Detect_marker(Movement):
|
|||
if not success:
|
||||
print("It seems that the image cannot be acquired correctly.")
|
||||
break
|
||||
|
||||
img = cv2.resize(img, None, fx=1.5, fy=1.5, interpolation=cv2.INTER_CUBIC)
|
||||
img = img[140:630, 240:730]
|
||||
|
||||
# transfrom the img to model of gray
|
||||
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue