Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Rewrite variable every n times
#1
I'm doing image processing with cv2, and i need to replace the background every 30 seconds during 2 minutes. The background will be something like a photo of the current chroma.



def Foto():
    cv2.imwrite("Fondo1.jpg",entrada4)
    entrada = cv2.imread("Fondo1.jpg")

....


t = threading.Timer(3.0,Foto)
t.start()

I think the problem is i'm defining "entrada" at the begining of my code but also defining "entrada" in the funtion Foto()

entrada = cv2.imread("Fondo.jpg")

def Foto():
    cv2.imwrite("Fondo1.jpg",entrada4)
    entrada = cv2.imread("Fondo1.jpg")
....
t = threading.Timer(3.0,Foto)
t.start()

I need every 30 seconds it rewrites the image "fondo1" and replace "entrada" with that image. Like taking a photo of what the chroma is showing and change the background witht the photo.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Cleaner way to rewrite fakka 5 230 Dec-05-2019, 04:53 AM
Last Post: stullis
  How do I rewrite this .bat file code onto Python? SteampunkMaverick12 4 202 Nov-02-2019, 11:28 PM
Last Post: snippsat
  Rewrite a function to make it work with 'bottle-pymysql' nikos 1 314 Feb-26-2019, 02:59 PM
Last Post: nikos
  piexif rewrite exif data yawstick 2 778 Oct-09-2018, 08:56 PM
Last Post: yawstick
  Not having to rewrite 'obj.' on each line beuaaa 4 685 Sep-30-2018, 02:21 AM
Last Post: micseydel
  How to rewrite image file name based on ocr data.txt kevinchr 0 1,050 Apr-16-2018, 07:09 PM
Last Post: kevinchr
  how do i rewrite this code to give me 10 outputs BlackPimpernel 2 682 Mar-29-2018, 11:29 AM
Last Post: BlackPimpernel

Forum Jump:


Users browsing this thread: 1 Guest(s)