[text] video

Viewer

  1. import cv2
  2. import numpy as np
  3.  
  4. # Load the background image (assumed to be a screenshot of the WhatsApp conversation)
  5. background = cv2.imread('whatsapp_screenshot.png')
  6.  
  7. # Create a mask for the phone screen
  8. screen_mask = np.zeros_like(background)
  9. screen_mask[70:400, 40:600] = 255
  10.  
  11. # Create a blank image to represent the phone screen
  12. screen = np.zeros_like(background)
  13.  
  14. # Add text to represent the conversation
  15. font = cv2.FONT_HERSHEY_SIMPLEX
  16. cv2.putText(screen, 'Studentja: Të nderuar mesues, unë kam pasur disa probleme familjare', (50, 50), font, 1, (255,255,255), 2, cv2.LINE_AA)
  17. cv2.putText(screen, 'Mesuesi: Unë kuptoj që mund të keni pasur probleme të vërteta,', (50, 100), font, 1, (255,255,255), 2, cv2.LINE_AA)
  18. cv2.putText(screen, 'por është shumë e rëndësishme që të njoftoni mungesat tuaja', (50, 150), font, 1, (255,255,255), 2, cv2.LINE_AA)
  19. cv2.putText(screen, 'në kohë për të mbajtur një regjistër të saktë të mesimeve', (50, 200), font, 1, (255,255,255), 2, cv2.LINE_AA)
  20.  
  21. # Add the phone screen to the background image using the mask
  22. background = cv2.bitwise_and(background, background, mask=cv2.bitwise_not(screen_mask))
  23. background = cv2.add(background, screen)
  24.  
  25. # Show the final composite image
  26. cv2.imshow('Biseda midis mesuesit dhe studentes', background)
  27. cv2.waitKey(0)
  28. cv2.destroyAllWindows()
  29.  

Editor

You can edit this paste and save as new:


File Description
  • video
  • Paste Code
  • 04 Feb-2023
  • 1.33 Kb
You can Share it: