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

Unwanted Horizontal Lines Appears when using cv2.putText() #8824

Closed
DEKHTIARJonathan opened this issue May 30, 2017 · 1 comment
Closed

Unwanted Horizontal Lines Appears when using cv2.putText() #8824

DEKHTIARJonathan opened this issue May 30, 2017 · 1 comment

Comments

@DEKHTIARJonathan
Copy link

DEKHTIARJonathan commented May 30, 2017

System information (version)
  • OpenCV => opencv-python==3.2.0.7
  • Operating System / Platform => Windows 10 64 Bit
  • Python 3.5.3 and installed with PIP with a virtualenv
Detailed description

I use the following dummy_code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys, cv2, time
import numpy as np

video_capture = cv2.VideoCapture(0)

h_offset  = 150
font      = cv2.FONT_HERSHEY_SIMPLEX
fontScale = 0.5
fontColor = (0, 255, 0)
thickness = 2

while True:
    
    start    = time.time()
    v_offset = 50 
    
    # Capture frame-by-frame
    ret, frame = video_capture.read()
    
    print("\n####################\n")
    
    for _ in range(5):
    
        printed_txt = "DOG" + " => " +str(round(25.3 ,1))+"%"
        cv2.putText(frame, printed_txt, (h_offset, v_offset), font, fontScale, fontColor, thickness)
        
        v_offset += 50
        
        print(printed_txt)

    cv2.imshow('Video', frame)

    key = cv2.waitKey(1)
    if key & 0xFF == ord('q'):
        break
    elif key & 0xFF == ord(' '):
        #raw_input("Press any key to stop pause")
        cv2.waitKey(0)       

    print("\nframe_rate: %2.2f images/sec" % (1 / (time.time() - start)))

# When everything is done, release the capture
video_capture.release()
cv2.destroyAllWindows()

Which leads to this screen :
image

Could anyone tell me why am I having these horizontal lines and how to remove them ?

Thanks a lot dear friends

@alalek
Copy link
Member

alalek commented May 30, 2017

Check this patch: #7959

opencv-python==3.2.0.7

This package is not supported here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants