Repository: kivy/kivy

Issue:
'float' object cannot be interpreted as an integer when calling `read_frame` on a `CameraAndroid`
**Software Versions**
* Python: 3.11
* OS: Android 14
* Kivy: 2.3.0
* Kivy installation method: pip (through Poetry)

**Describe the bug**
Calling `camera.read_frame()` from `on_tex`'s `camera` argument in a subclass of `kivy.uix.camera.Camera` throws with:

```
'float' object cannot be interpreted as an integer
```

**Expected behavior**
`camera.read_frame()` returns a numpy array to use with OpenCV

**To Reproduce**
A short, *runnable* example that reproduces the issue with *latest kivy master*.

Note: I did not try reproducing with master because building the wheel from master (3eadfd9fdeb4f0fb1f1a8e786e88952e0a8c42ec) fails

```python
# coding:utf-8
from android.permissions import Permission, request_permissions
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.camera import Camera

Builder.load_string("""
#:kivy 2.3.0
<RootLayout>
    orientation: 'vertical'
    size: root.width, root.height

    Cam:
        index: 0
        # resolution: self.camera_resolution
        allow_stretch: True
        play: True
""")

class Cam(Camera):
    def on_tex(self, camera):
        frame = camera.read_frame()
        return super().on_tex(camera)


class RootLayout(BoxLayout):
    pass


class MyApp(App):
    def build(self):
        return RootLayout()

if __name__ == "__main__":
    request_permissions([Permission.CAMERA])
    MyApp().run()
```

**Code and Logs and screenshots**
```python
# coding:utf-8
from android.permissions import Permission, request_permissions
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.camera import Camera
from rich import print

Builder.load_string("""
#:kivy 2.3.0
<RootLayout>
    orientation: 'vertical'
    size: root.width, root.height

    Cam:
        # index: 0
        # resolution: self.camera_resolution
        # allow_stretch: True
        # play: True
""")

class Cam(Camera):
    def on_tex(self, camera):
        print(f"on_texture: {camera}")
        try:
            frame = camera.read_frame()
            print(f"frame @ {frame.shape}")
        except Exception as e:
            print(e)
            pass
        return super().on_tex(camera)


class RootLayout(BoxLayout):
    pass


class AudioseekApp(App):
    def build(self):
        return RootLayout()


if __name__ == "__main__":
    request_permissions([Permission.CAMERA])
    AudioseekApp().run()
```


Logcat:
```logcat
06-10 17:10:03.910 20603 20730 I python  : 'float' object cannot be interpreted as an integer
06-10 17:10:03.941 20603 20730 I python  : on_texture: <kivy.core.camera.camera_android.CameraAndroid object at 
06-10 17:10:03.941 20603 20730 I python  : 0x76e27f3000>
```

**Additional context**

The stacktrace points to `decode_frame`, see https://github.com/kivy/kivy/blob/3eadfd9fdeb4f0fb1f1a8e786e88952e0a8c42ec/kivy/core/camera/camera_android.py#L191



Discussion:

Resolving patch:
diff --git a/kivy/core/camera/camera_android.py b/kivy/core/camera/camera_android.py
--- a/kivy/core/camera/camera_android.py
+++ b/kivy/core/camera/camera_android.py
@@ -188,7 +188,7 @@ def decode_frame(self, buf):
         from cv2 import cvtColor
 
         w, h = self._resolution
-        arr = np.fromstring(buf, 'uint8').reshape((h + h / 2, w))
+        arr = np.fromstring(buf, 'uint8').reshape((h + h // 2, w))
         arr = cvtColor(arr, 93)  # NV21 -> BGR
         return arr
 


Test patch: