react-native-vision-camera: ๐ Camera is not aligned properly when using `useSkiaFrameProcessor`
Whatโs happening?
๐ [^4.0.0-beta.16] - Camera is not aligned properly when using useSkiaFrameProcessor but itโs work with
Reproduceable Code
return (
<SafeAreaView style={styles.container}>
{!hasPermission && <Text>No Camera Permission.</Text>}
{hasPermission && device != null && (
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
photo={true}
video={true}
format={format}
onError={(err)=> { console.log("err **",err)}}
fps={fps}
enableFpsGraph={true}
frameProcessor={frameProcessor}
videoHdr={format.supportsVideoHdr}
photoHdr={format.supportsPhotoHdr}
enableZoomGesture={false}
/>
)}
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
Relevant log output
none
Camera Device
none
Device
vivo y21
VisionCamera Version
[^4.0.0-beta.16]
Can you reproduce this issue in the VisionCamera Example app?
I didnโt try (โ ๏ธ your issue might get ignored & closed if you donโt try this)
Additional information
- I am using Expo
- I have enabled Frame Processors (react-native-worklets-core)
- I have read the Troubleshooting Guide
- I agree to follow this projectโs Code of Conduct
- I searched for similar issues in this repository and found none.
About this issue
- Original URL
- State: open
- Created 2 months ago
- Comments: 18 (14 by maintainers)
then you will have zero issues in vc ๐
i think that i found a fix for this, should send a pr some time tomorrow
then itโs probably the sensor to buffer transform matrix.
Try playing around with the code from
useSkiaFrameProcessor
: https://github.com/mrousavy/react-native-vision-camera/blob/3ff02cc6b4fc34154ec6fb5e650e074e34408e47/package/src/skia/useSkiaFrameProcessor.ts#L165-L175Maybe weโre doing something wrong.
Also, the
ImageProxy
(which is what the nativeFrame
type holds) contains agetSensorToBufferTransformMatrix()
method - maybe we can use this Matrix to transform the Frame safely to view dimensions? cc @rodgomesc if you wanna look into this.