Kivy Con opencv. Cambiar el tamaño del tamaño de la imagen

Quiero insertar un video de cámara web opencv en kivy. Desafortunadamente, cuando hago esto y maximizo la ventana, la imagen no se ajusta al tamaño de la pantalla. ¿Hay alguna forma de hacer esto?

from kivy.app import App
from kivy.uix.image import Image
from kivy.clock import Clock
from kivy.graphics.texture import Texture
import cv2

from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.lang import Builder
from kivy.core.window import Window
Window.size=(1000,1000)


class KivyCamera(Image):
    def __init__(self, capture, fps, **kwargs):
        super(KivyCamera, self).__init__(**kwargs)
        self.capture = capture
        Clock.schedule_interval(self.update, 1.0 / fps)

    def update(self, dt):
        ret, frame = self.capture.read()
        if ret:
            buf1 = cv2.flip(frame, 0)
            buf = buf1.tostring()
            image_texture = Texture.create(size=(frame.shape[1], frame.shape[0]), colorfmt='rgb')#(480,640)
            image_texture.blit_buffer(buf, colorfmt='bgr', bufferfmt='ubyte')
            # display image from the texture
            self.texture = image_texture


class CamApp(App):
    def build(self):
        self.camera= cv2.VideoCapture(2)
        self.my_camera = KivyCamera(capture=self.camera, fps=10,resolution=(1280,960))
        return self.my_camera

    def on_stop(self):
        self.camera.release()


if __name__ == '__main__':
    CamApp().run()

Espero que el tamaño del marco aumente cuando aumente el tamaño de winow. Cuando trato de cambiar el tamaño en Texture me da un error. Al igual que muestra imágenes extrañas o no abre ninguna ventana. Sería genial si alguien pudiera ayudar. Gracias !

Respuestas a la pregunta(0)

Su respuesta a la pregunta