lxy 1 year ago
parent
commit
d5d879aba7

+ 2 - 2
Example/LenzCameraNativeModuleForRN.xcodeproj/project.pbxproj

@@ -459,7 +459,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN-Prefix.pch";
 				INFOPLIST_FILE = "LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				MODULE_NAME = ExampleApp;
 				ONLY_ACTIVE_ARCH = NO;
 				PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
@@ -479,7 +479,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN-Prefix.pch";
 				INFOPLIST_FILE = "LenzCameraNativeModuleForRN/LenzCameraNativeModuleForRN-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				MODULE_NAME = ExampleApp;
 				PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}";
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 2 - 2
Example/Podfile.lock

@@ -1,5 +1,5 @@
 PODS:
-  - LenzSDK (1.1.2):
+  - LenzSDK (1.1.3):
     - Masonry (= 1.1.0)
     - OpenCV2 (~> 4.3.0)
     - SVProgressHUD (~> 2.2.5)
@@ -27,7 +27,7 @@ EXTERNAL SOURCES:
     :path: "../"
 
 SPEC CHECKSUMS:
-  LenzSDK: 09d126913b92601194722621132bee6c8ffadf84
+  LenzSDK: 1dbcc855ba1976e39af4d9bd651fb3f69cc61cd0
   Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   OpenCV2: ffe82e5cb5d16dc3fc01a5f4127b9a5b3cfc7d1b
   SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6

+ 2 - 2
Example/Pods/Local Podspecs/LenzSDK.podspec.json

@@ -1,6 +1,6 @@
 {
   "name": "LenzSDK",
-  "version": "1.1.2",
+  "version": "1.1.3",
   "summary": "A short description of LenzSDK.",
   "description": "this  is the long description",
   "homepage": "http://39.96.8.150:10080/l405023944/LenzSDK_iOS.git",
@@ -13,7 +13,7 @@
   },
   "source": {
     "git": "http://39.96.8.150:10080/l405023944/LenzSDK_iOS.git",
-    "tag": "1.1.2"
+    "tag": "1.1.3"
   },
   "platforms": {
     "ios": "11.0"

+ 2 - 2
Example/Pods/Manifest.lock

@@ -1,5 +1,5 @@
 PODS:
-  - LenzSDK (1.1.2):
+  - LenzSDK (1.1.3):
     - Masonry (= 1.1.0)
     - OpenCV2 (~> 4.3.0)
     - SVProgressHUD (~> 2.2.5)
@@ -27,7 +27,7 @@ EXTERNAL SOURCES:
     :path: "../"
 
 SPEC CHECKSUMS:
-  LenzSDK: 09d126913b92601194722621132bee6c8ffadf84
+  LenzSDK: 1dbcc855ba1976e39af4d9bd651fb3f69cc61cd0
   Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   OpenCV2: ffe82e5cb5d16dc3fc01a5f4127b9a5b3cfc7d1b
   SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6

+ 1 - 1
Example/Pods/Target Support Files/LenzSDK/ResourceBundle-LenzCameraNativeModuleForRN-LenzSDK-Info.plist

@@ -13,7 +13,7 @@
   <key>CFBundlePackageType</key>
   <string>BNDL</string>
   <key>CFBundleShortVersionString</key>
-  <string>1.1.2</string>
+  <string>1.1.3</string>
   <key>CFBundleSignature</key>
   <string>????</string>
   <key>CFBundleVersion</key>

+ 38 - 8
LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m

@@ -128,6 +128,7 @@
 @property (nonatomic) NSNumber *startRollY;
 @property (nonatomic) LenzTensorFlow *tensorFlow;
 @property (nonatomic) BOOL isContainSingleInReatinMode;
+@property (nonatomic) UILabel *aiPanPromtLabel;
 
 @end
 
@@ -170,6 +171,13 @@
     [self panoramaOrientationViewslt:(PanoramaOrientationViewLeft)];
     self.panoramaGuideView.hidden = YES;
     
+    [self.view addSubview:self.aiPanPromtLabel];
+    [self.aiPanPromtLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.mas_equalTo(self.view);
+        make.top.mas_equalTo(self.modeLabel.mas_bottom).mas_offset(20);
+        make.width.mas_offset(240);
+        make.height.mas_offset(20);
+    }];
     if (!JK_IS_IPHONE_X) {
         self.safeBottom.constant = 25;
         self.safeTop.constant = 15;
@@ -264,7 +272,8 @@
                     PhotographModeEnum mode = (PhotographModeEnum)MODE_LIST_INDEX_2_MODE_ENUM(newMode);
                     strongSelf.mode = mode;
 
-                    self.ai_fullView.hidden = !(mode == SDK_CAPTURE_MODE_PANORAMA);
+//                    self.ai_fullView.hidden = !(mode == SDK_CAPTURE_MODE_PANORAMA);
+                    self.ai_fullView.hidden = YES;
                     [strongSelf modeDidChange:newMode oldIndex:oldMode];
                     [strongSelf updateCaptureSessionWith:oldMode];
                     if([oldModelNode respondsToSelector:@selector(didQuit)]){
@@ -284,7 +293,8 @@
         PhotographModeEnum mode = (PhotographModeEnum)MODE_LIST_INDEX_2_MODE_ENUM(newMode);
         strongSelf.mode = mode;
 
-        self.ai_fullView.hidden = !(mode == SDK_CAPTURE_MODE_PANORAMA);
+//        self.ai_fullView.hidden = !(mode == SDK_CAPTURE_MODE_PANORAMA);
+        self.ai_fullView.hidden = YES;
         [strongSelf modeDidChange:newMode oldIndex:oldMode];
         [strongSelf updateCaptureSessionWith:oldMode];
         if([oldModelNode respondsToSelector:@selector(didQuit)]){
@@ -442,6 +452,8 @@
                 break;
         }
     }
+    
+    [self showAuthorCamerIfNeed];
 }
 
 - (void)viewWillDisappear:(BOOL)animated{
@@ -516,7 +528,20 @@
     }
     return _loadingAnimation;
 }
-
+- (UILabel *)aiPanPromtLabel {
+    if (!_aiPanPromtLabel) {
+        _aiPanPromtLabel = [[UILabel alloc]init];
+        _aiPanPromtLabel.backgroundColor = [UIColor colorWithRed:33/255.0 green:33/255.0 blue:33/255.0 alpha:.2];
+        _aiPanPromtLabel.layer.cornerRadius = 6;
+        _aiPanPromtLabel.layer.masksToBounds = YES;
+        _aiPanPromtLabel.textColor = [UIColor whiteColor];
+        _aiPanPromtLabel.font = [UIFont systemFontOfSize:14];
+        _aiPanPromtLabel.text = @"请保持手机与拍摄物平行,匀速拍摄";
+        _aiPanPromtLabel.hidden = YES;
+        _aiPanPromtLabel.textAlignment = NSTextAlignmentCenter;
+    }
+    return _aiPanPromtLabel;
+}
 
 - (UILabel *)stitchLabel {
     if (!_stitchLabel) {
@@ -1258,7 +1283,8 @@
             self.panoramaGuideView.hidden = YES;
         } else {
             self.panoramOrientationGuideView.hidden = isSaveIng;
-            self.ai_fullView.hidden = isSaveIng;
+//            self.ai_fullView.hidden = isSaveIng;
+            self.ai_fullView.hidden = YES;
             self.panoramaGuideView.hidden = isSaveIng;
         }
         self.modeList.hidden = isSaveIng;
@@ -1288,7 +1314,8 @@
             self.panoramOrientationGuideView.hidden = YES;
             self.panoramaGuideView.hidden = YES;
         } else {
-            self.ai_fullView.hidden = NO;
+//            self.ai_fullView.hidden = NO;
+            self.ai_fullView.hidden = YES;
             self.panoramOrientationGuideView.hidden = NO;
             self.panoramaGuideView.hidden = NO;
         }
@@ -1458,7 +1485,8 @@
     self.albumButton.hidden = YES;
     self.numberOfImagesLabel.hidden = YES;
     self.modeLabel.text = self.currentOperationNode.modeTitleString;
-    self.ai_fullView.hidden = !(self.mode == SDK_CAPTURE_MODE_PANORAMA);
+//    self.ai_fullView.hidden = !(self.mode == SDK_CAPTURE_MODE_PANORAMA);
+    self.ai_fullView.hidden = YES;
     self.panGesture.enabled = YES;
     
 //    self.controller.savePhotoButton.hidden = !self.hasCache;
@@ -2079,6 +2107,7 @@
 
 
 - (void)updateNumberLabel {
+    self.aiPanPromtLabel.hidden = YES;
     switch (self.mode) {
         case SDK_CAPTURE_MODE_CONTINUOUS: {
             if (self.resourceModel.continousArray.count > 0) {
@@ -2113,6 +2142,7 @@
             break;
         case SDK_CAPTURE_MODE_INTELLEGENCE_PANORAMA:
         {
+            self.aiPanPromtLabel.hidden = NO;
             if (self.resourceModel.aiPanoramArray.count > 0) {
                 self.numberOfImagesLabel.hidden = NO;
                 self.numberOfImagesLabel.text = [NSString stringWithFormat:@"已拍摄%ld张", self.resourceModel.aiPanoramArray.count];
@@ -2685,9 +2715,9 @@
                         [SVProgressHUD dismissWithDelay:3 completion:^{
                         }];
                     } else if(result == LenVideoStitchResultSlowMore) {
-                        [SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"移动速度过快,请匀速拍摄"];
+                        [SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"目标物较少,请对准目标物低速且匀速拍摄"];
                     } else if (result == LenVideoStitchResultSlow) {
-                        [SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"图像中目标物体较少,请对准货架进行拍摄"];
+                        [SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"目标物较少,请对准目标物低速且匀速拍摄"];
                     } else {
 //                        [SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"请勿往反方向移动"];
                     }

+ 8 - 2
LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSPreviewViewController.m

@@ -97,6 +97,7 @@
     if (!_player) {
         _player = [[AVPlayerViewController alloc]init];
         _player.view.hidden = YES;
+        _player.videoGravity = AVLayerVideoGravityResizeAspect;
     }
     return _player;
 }
@@ -260,6 +261,11 @@
     });
 }
 
+- (void)viewDidLayoutSubviews{
+    [self.view layoutIfNeeded];
+    [self.collectionView scrollToItemAtIndexPath:self.currentIndexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO];
+}
+
 - (UIImageView *)lineImageView {
     if (!_lineImageView) {
         _lineImageView = [[UIImageView alloc]init];
@@ -468,10 +474,10 @@
 
 - (void)changeAction:(UITapGestureRecognizer *)tap {
 
-    
+    [self.view layoutIfNeeded];
     UILabel *label = (UILabel *)tap.view;
     self.currentIndexPath = [NSIndexPath indexPathForItem:0 inSection:label.tag - 1];
-    [self.collectionView scrollToItemAtIndexPath:self.currentIndexPath atScrollPosition:0 animated:YES];
+//    [self.collectionView scrollToItemAtIndexPath:self.currentIndexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO];
     [self changeLabelStatusWith:label.tag];
     [self updateCountLabelWith:self.currentIndexPath];
 

+ 1 - 1
LenzSDK.podspec

@@ -8,7 +8,7 @@
 
 Pod::Spec.new do |s|
   s.name             = 'LenzSDK'
-  s.version          = '1.1.3'
+  s.version          = '1.1.4'
   s.summary          = 'A short description of LenzSDK.'
 
 # This description is used to generate tags and improve search results.