chaejoo@lifentech.com
image_bgr = cv2.imread(image_file)
img_hsv_h = image_hsv[:, :, 0]
img_hsv_s = image_hsv[:, :, 1]
img_hsv_v = image_hsv[:, :, 2]
lower_red1 = (0.95*180, 0.4*255*0.6, 0)
upper_red1 = (180, 255, 0.97*255)
lower_red2 = (0, 0.4*255*0.6, 0)
upper_red2 = (0.1*180, 255, 0.97*255)
img_hsv = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2HSV)
img_hsv1 = cv2.inRange(img_hsv, lower_red1, upper_red1)
img_hsv2 = cv2.inRange(img_hsv, lower_red2, upper_red2)
img_red = cv2.bitwise_or(img_hsv1, img_hsv2)
#Clear up by getting rid of particles less than 400 pixels in area.
imge_red = baweraopen(img_red,4000)
imge_red = imge_red - baweraopen(imge_red,19000)
# and remove bigsize
# Fill any holes in the blobs.
imge_red = img_fill(imge_red, 127)
cv2.imshow('IMG', imge_red)
cv2.waitKey(0)
댓글 없음:
댓글 쓰기