Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rknn_yolov5_android_apk_demo modifying the flip parameter does not take effect #198

Open
Starkguava opened this issue Oct 24, 2024 · 0 comments

Comments

@Starkguava
Copy link

public class CameraPreviewActivity extends Activity implements Camera.PreviewCallback {

private final String TAG = "rkyolo";
private static final int MAGIC_TEXTURE_ID = 10;

TSurfaceHolderCallback mSurfaceHolderCallback = null;

private Camera mCamera0 = null;
private SurfaceView mSurfaceView = null;
public SurfaceTexture mSurfaceTexture = null;
private SurfaceHolder mSurfaceHolder = null;

public int flip = -1;    // for CAMERA_FACING_BACK(camera comes with RK3588 using this mode),
                         // we do not need flip, using -1, or we need using
                         // IM_HAL_TRANSFORM_FLIP_H

When I run this demo with an external USB camera on the 3588 board, the image is mirrored. I have tried modifying the parameter to -1, 0, 1, and IM_HAL_TRANSFORM_FLIP_H (public static final int IM_HAL_TRANSFORM_FLIP_H = (1 << 3); // 0x08), but none of these changes have any effect; the image remains mirrored. This includes the startCamera() method where the condition
if (Camera.CameraInfo.CAMERA_FACING_FRONT == camInfo.facing) {
this.flip = IM_HAL_TRANSFORM_FLIP_H;
}

does not work even when commented out.

@Starkguava Starkguava changed the title rknn_yolov5_android_)apk_demo modifying the flip parameter does not take effect rknn_yolov5_android_apk_demo modifying the flip parameter does not take effect Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant