removed redundant camera rotation parameter from PoseTrackingOptions

This commit is contained in:
Mautisim Munir 2022-10-05 20:56:45 +05:00
parent d971143040
commit 8372703870
4 changed files with 13 additions and 6 deletions

View File

@ -15,7 +15,7 @@
"""Configuration helper for iOS app bundle ids and provisioning profiles. """Configuration helper for iOS app bundle ids and provisioning profiles.
""" """
BUNDLE_ID_PREFIX = "*SEE_IOS_INSTRUCTIONS*.mediapipe.examples" BUNDLE_ID_PREFIX = "a09f2333-1ef2-4378-b82d-658a2d248aa5.mediapipe.examples"
# Look for a provisioning profile in the example's directory first, # Look for a provisioning profile in the example's directory first,
# otherwise look for a common one. # otherwise look for a common one.

View File

@ -31,7 +31,7 @@ static const char* kLandmarksOutputStream = "pose_landmarks";
[super viewDidLoad]; [super viewDidLoad];
// create pose tracking options // create pose tracking options
PoseTrackingOptions* options = [ [PoseTrackingOptions alloc] initWithShowLandmarks:true cameraRotation:0]; PoseTrackingOptions* options = [ [PoseTrackingOptions alloc] initWithShowLandmarks:true];
// create pose tracking from options // create pose tracking from options
self.poseTracking = [[PoseTracking alloc] initWithPoseTrackingOptions:options]; self.poseTracking = [[PoseTracking alloc] initWithPoseTrackingOptions:options];
// render pose tracking to a UIView (self.liveView) // render pose tracking to a UIView (self.liveView)
@ -63,7 +63,14 @@ static const char* kLandmarksOutputStream = "pose_landmarks";
//self.cameraSource.videoMirrored = YES; //self.cameraSource.videoMirrored = YES;
// The frame's native format is rotated with respect to the portrait orientation. // The frame's native format is rotated with respect to the portrait orientation.
// 0 degree
self.cameraSource.orientation = AVCaptureVideoOrientationPortrait; self.cameraSource.orientation = AVCaptureVideoOrientationPortrait;
//90 degree
// self.cameraSource.orientation = AVCaptureVideoOrientationLandscapeRight;
//180 degree
// self.cameraSource.orientation = AVCaptureVideoOrientationPortraitUpsideDown;
//270 degree
// self.cameraSource.orientation = AVCaptureVideoOrientationLandscapeLeft;
// request camera access permission // request camera access permission
[self.cameraSource requestCameraAccessWithCompletionHandler:^void(BOOL granted) { [self.cameraSource requestCameraAccessWithCompletionHandler:^void(BOOL granted) {

View File

@ -8,9 +8,9 @@
@interface PoseTrackingOptions: NSObject @interface PoseTrackingOptions: NSObject
@property(nonatomic) bool showLandmarks; @property(nonatomic) bool showLandmarks;
@property(nonatomic) int cameraRotation; //@property(nonatomic) int cameraRotation;
- (instancetype) initWithShowLandmarks : (bool) showLandmarks cameraRotation:(int) cameraRotation; - (instancetype) initWithShowLandmarks : (bool) showLandmarks;
@end @end

View File

@ -2,8 +2,8 @@
@implementation PoseTrackingOptions @implementation PoseTrackingOptions
- (instancetype) initWithShowLandmarks : (bool) showLandmarks cameraRotation:(int) cameraRotation{ - (instancetype) initWithShowLandmarks : (bool) showLandmarks {
self.cameraRotation = cameraRotation; // self.cameraRotation = cameraRotation;
self.showLandmarks = showLandmarks; self.showLandmarks = showLandmarks;
return self; return self;
} }