-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate a new image with bounding box and circles #25
Comments
Something like this image = cv2.imread("max.jpg") bounding_box = result[0]['box'] cv2.rectangle(image, cv2.imwrite("max_drawn.jpg", image) |
Hello
Yes, thank you, i am using plt plot instead of cv.2 imshow
but I have solved the problem.
Do you mind if i add you on the wechat?
I am chinese, but i have been studying in Canada since 2010.
My wechat: wangjianzhou159162
谢谢
Maxwell (汪见舟) On Thursday, November 22, 2018, 12:12:24 PM EST, SpeedOfSpin <[email protected]> wrote:
Something like this
image = cv2.imread("max.jpg")
result = detector.detect_faces(image)
bounding_box = result[0]['box']
keypoints = result[0]['keypoints']
cv2.rectangle(image,
(bounding_box[0], bounding_box[1]),
(bounding_box[0]+bounding_box[2], bounding_box[1] + bounding_box[3]),
(0,155,255),
2)
cv2.circle(image,(keypoints['left_eye']), 2, (0,155,255), 2)
cv2.circle(image,(keypoints['right_eye']), 2, (0,155,255), 2)
cv2.circle(image,(keypoints['nose']), 2, (0,155,255), 2)
cv2.circle(image,(keypoints['mouth_left']), 2, (0,155,255), 2)
cv2.circle(image,(keypoints['mouth_right']), 2, (0,155,255), 2)
cv2.imwrite("max_drawn.jpg", image)
cv2.namedWindow("image")
cv2.imshow("image",image)
cv2.waitKey(0)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hello, thanks for sharing your code
How to generate a new image with bounding box and circles?
I tried to code:
>>> from mtcnn.mtcnn import MTCNN
>>> import cv2
>>>
>>> img = cv2.imread("max.jpg")
>>> detector = MTCNN()
>>> print(detector.detect_faces(img))
>>> image = cv2.imwrite("max_drawn.jpg",img)
(max.jpg is my picture)
thank you
The text was updated successfully, but these errors were encountered: