Skip to content

Frame Processor Error: Failed to convert NativeBuffer to SkImage in VisionCamera example app #104

@YOEL311

Description

@YOEL311

Describe the bug

When running the example app in this repository and selecting Camera Realtime Detection or Document Detection in the home screen, the app crashes with the following error:

Frame Processor Error: Exception in HostFunction: Failed to convert NativeBuffer to SkImage!, js engine: VisionCamera

Steps to reproduce

  1. Open the example app.
  2. Select 'Camera Realtime Detection' or 'Document Detection' from the Examples list.
  3. App crashes and shows the error above in the React Native DevTools console.

Screenshots/Console Output
image1
image2

Environment

  • Library: react-native-fast-opencv
  • Example app from repo
  • Using VisionCamera for frame processing

Additional context

  • Error seems related to converting NativeBuffer to SkImage in VisionCamera frame processor.
  • Occurs during real-time document detection or object detection.

Expected behavior

  • Example should process camera frame without throwing SkImage conversion error.

Possible causes

  • Buffer format/pixelFormat or channel count mismatch with SkImage expectations.
  • Issue with VisionCamera or react-native-skia integration.

Please advise on how to fix or workaround this issue. Any guidance or update would be appreciated.


Relevant images attached for reference.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions