Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added screen rotation support to JavaCamera2View amd NativeCameraView. Fixed JavaCamera2View initialization.#24869

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@alexlyulkov
Copy link
Contributor

Added automatic image rotation to JavaCamera2View and NativeCameraView so the video preview was matched with screen orientation.
Fixed double preview initialization bug in JavaCamera2View.
Added proper cameraID parsing to NativeCameraView similar to JavaCameraView

Pull Request Readiness Checklist

See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

}

Log.i(LOGTAG,"Opening camera: " +mCameraID);
manager.openCamera(mCameraID,mStateCallback,mBackgroundHandler);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Moved camera starting here, because preview size should be defined before camera start

mCaptureSession.close();
mCaptureSession =null;
}
createCameraPreviewSession();
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

There is already a createCameraPreviewSession call in onOpened camera callback.

@asmorkalov
Copy link
Contributor

@alexlyulkov I do not see preview with Pixel8 in Tutorial 4. Just black screen with text status in corner.

@asmorkalov
Copy link
Contributor

Tutorial1-Camera-Preview works with all back-ends JavaCameraView, Java2CameraView and NativeCameraView with rotation. Please ignore the previous comment on Tutorial4. The sample does not work without the patch. It should be fixed separately.

Comment on lines 129 to 131
android.hardware.Camera.CameraInfoinfo =newandroid.hardware.Camera.CameraInfo();
android.hardware.Camera.getCameraInfo(localCameraIndex,info);
intframeRotation =getFrameRotation(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks like you can re-use CameraInfo from cameras iteration when camera is selected.

Copy link
Contributor

@asmorkalovasmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

@asmorkalovasmorkalov merged commitbfad61f intoopencv:4.xJan 17, 2024
@asmorkalovasmorkalov mentioned this pull requestJan 23, 2024
JStech pushed a commit to JStech/opencv that referenced this pull requestJan 28, 2024
…ew-rotateAdded screen rotation support to JavaCamera2View amd NativeCameraView. Fixed JavaCamera2View initialization.opencv#24869Added automatic image rotation to JavaCamera2View and NativeCameraView so the video preview was matched with screen orientation.Fixed double preview initialization bug in JavaCamera2View.Added proper cameraID parsing to NativeCameraView similar to JavaCameraView### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV- [x] The PR is proposed to the proper branch- [ ] There is a reference to the original bug report and related work- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable      Patch to opencv_extra has the same branch name.- [x] The feature is well documented and sample code can be built with the project CMake
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@asmorkalovasmorkalovasmorkalov approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.10.0

Development

Successfully merging this pull request may close these issues.

2 participants

@alexlyulkov@asmorkalov

[8]ページ先頭

©2009-2025 Movatter.jp