mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
docs: remove unneeded trailing spaces and fix a typo
This commit is contained in:
@@ -40,7 +40,7 @@ def image_colback_color(data):
|
||||
global color, shape
|
||||
|
||||
cv_image = bridge.imgmsg_to_cv2(data, 'bgr8') # OpenCV image
|
||||
img_hsv = cv2.cvtColor(cv_image, cv2.COLOR_BGR2HSV) #[118:119,158:159]
|
||||
img_hsv = cv2.cvtColor(cv_image, cv2.COLOR_BGR2HSV) #[118:119,158:159]
|
||||
|
||||
#detected color
|
||||
#print(img_hsv[0][0])
|
||||
@@ -80,7 +80,7 @@ if shape = 'brown':
|
||||
if shape = 'yellow_orange':
|
||||
culture = "pshenitsa"
|
||||
|
||||
image_sub = rospy.Subscriber('main_camera/image_raw', Image, image_colback_color)
|
||||
image_sub = rospy.Subscriber('main_camera/image_raw', Image, image_colback_color)
|
||||
```
|
||||
|
||||
The script will take up to 100% CPU capacity. To slow down the script artificially, you can use throttling of frames from the camera, for example, at 5 Hz (`main_camera.launch`):
|
||||
@@ -141,7 +141,7 @@ violet_low = (143, 150, 150)
|
||||
violet_high = (157, 255, 255)
|
||||
|
||||
red_violet_low = (158, 150, 150)
|
||||
red_violet_hugh = (171, 255, 255)
|
||||
red_violet_hugh = (171, 255, 255)
|
||||
```
|
||||
|
||||
Note that there are two ranges for red because red is at the edges of the HSV color space.
|
||||
|
||||
@@ -73,7 +73,7 @@ elif brown_mask[119][159] == 255:
|
||||
|
||||
else:
|
||||
shape = 'undefined'
|
||||
color = 'undefined'
|
||||
color = 'undefined'
|
||||
|
||||
if shape = 'brown':
|
||||
culture = "greshiha"
|
||||
@@ -96,10 +96,10 @@ print (culture)
|
||||
while not rospy.is_shutdown():
|
||||
print("color: {}".format(color))
|
||||
print("shape: {}".format(shape))
|
||||
rospy.sleep(0.2)
|
||||
rospy.sleep(0.2)
|
||||
```
|
||||
|
||||
Данная программа будет определять культуру по её оттенку. Для повышения точности определения можно использовать больше цветовых диапазонов и дрон сможет распознавать большее колличество культур.
|
||||
Данная программа будет определять культуру по её оттенку. Для повышения точности определения можно использовать больше цветовых диапазонов и дрон сможет распознавать большее количество культур.
|
||||
|
||||
Вот примеры цветовых диапазонов:
|
||||
|
||||
@@ -141,7 +141,7 @@ violet_low = (143, 150, 150)
|
||||
violet_high = (157, 255, 255)
|
||||
|
||||
red_violet_low = (158, 150, 150)
|
||||
red_violet_hugh = (171, 255, 255)
|
||||
red_violet_hugh = (171, 255, 255)
|
||||
```
|
||||
|
||||
Обратите внимание, что для красного цвета используется два диапазона т. к. красный цвет находится на границах цветового пространства HSV.
|
||||
|
||||
Reference in New Issue
Block a user