Skip to content
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

Fix bugs in darknet_video.py #7908

Merged
merged 2 commits into from
Jul 15, 2021
Merged

Fix bugs in darknet_video.py #7908

merged 2 commits into from
Jul 15, 2021

Conversation

yamahitsuji
Copy link

I found darknet_video.py don't save output video correctly and fixed 2 bugs.

  1. cv2.VideoWriter frame size
    cv2.VideoWriter frame size must be original video size (not resized image size).
  2. converting rgb to bgr
    A image is already bgr.

@AlexeyAB AlexeyAB merged commit 7d75fe3 into AlexeyAB:master Jul 15, 2021
@AlexeyAB
Copy link
Owner

@yamahitsuji Thanks!

@SatyaNekkanti
Copy link

Hi @yamahitsuji

  • I was trying to figure out why do we need to invert the color band of a video frame here https://github.com/AlexeyAB/darknet/blob/master/darknet_video.py#L113
  • OpenCV VideoCapture function directly loads the video frame with True Color band(RGB) whereas OpenCV loads images in the inverted color band (BGR) Please correct me if I am wrong.
  • Does the invert of color band mess up with darknet detections?

juhong-rdv pushed a commit to juhong-rdv/darknet that referenced this pull request Dec 18, 2021
* fix VideoWriter frame size

* fix saved image color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants