Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

NatDevice - Media Device API

Discussion in 'Assets and Asset Store' started by Lanre, Dec 17, 2015.

?

Should we add exposure controls in v1.3? This means dropping support for iOS 7

Poll closed Jun 10, 2016.
  1. Yes

    9 vote(s)
    75.0%
  2. No

    3 vote(s)
    25.0%
  1. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi @spiningit that sounds normal when screenshotting pictures. The picture you get is the resolution of the screen, whereas a raw photo from the camera can be as high as 12 megapixels. NatCam will take very high resolution images. I have PM'ed you.
     
    Cromfeli likes this.
  2. charyyc

    charyyc

    Joined:
    Jun 1, 2016
    Posts:
    10
    How to save the captured photos on android devices? I have tried to use EncodeToPNG to save NatCam.Preview, but the image is black.
     
  3. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi @charyyc you can use:
    Code (CSharp):
    1. NatCam.PhotoSaveMode = PhotoSaveMode.SaveToPhotos;
    NatCam will automatically save the photos you capture to the gallery or to an album titled [app name]. If you want to save privately, you must use:
    Code (CSharp):
    1. var png = NatCam.PreviewFrame.EncodeToPNG();
    If you do this, make sure NatCam was initialized with PreviewType.ReadablePreview. Also be careful of your memory consumption when you call NatCam.PreviewFrame. If you will call it often, either make sure you cache the texture returned then destroy it when you are done:
    Code (CSharp):
    1. Texture2D frame = NatCam.PreviewFrame;
    2. frame.EncodeToPNG();
    3. Destroy(frame);
    4.  
    5. Destroy(NatCam.PreviewFrame); //Note that this will NOT work because you will only be destroying a Texture2D you just allocated by calling PreviewFrame
    Or to avoid allocating memory continuously, you can comment this line:
    Code (CSharp):
    1. #define ALLOCATE_NEW_FRAME_TEXTURES
    at the top of NatCamNativeInterface.cs and NatCamFallbackInterface.cs. If you do this, you don't have to worry about caching and calling Destroy because NatCam will manage the memory for you.

    NatCam.Preview is an external texture now, so all calls that require access to texture data in system memory (like GetPixel(s)(32), SetPixel(s)(32), and EncodeToJPG/PNG) will fail.
     
  4. charyyc

    charyyc

    Joined:
    Jun 1, 2016
    Posts:
    10
    Hi, Lanre.

    When I try to use "NatCam.PhotoSaveMode= PhotoSaveMode.SaveToPhotos;" in C# code, the unity editor throws an error with "Assets/NatCam/Example/Unitygram.cs(33,24): error CS0117: `NatCamU.NatCam' does not contain a definition for `PhotoSaveMode".
    Is there anything missing?

    When I try to save privately, it still fails(the image is still black).The following is my code using in the example project named Unitygram:
    Code (CSharp):
    1.  
    2.     // Use this for initialization
    3.     void Start () {
    4.         //Initialize NatCam
    5.         NatCam.Initialize(PreviewType.Readable);
    6.         //Set the rear camera active
    7.         NatCam.SetActiveCamera(DeviceCamera.RearCamera);
    8.         //Set the resolution to HD, 720p
    9.         NatCam.SetResolution(ResolutionPreset.HD);
    10.         //Start the camera preview
    11.         NatCam.Play();
    12.         //Set the focus mode to autofocus
    13.         NatCam.FocusMode = FocusMode.Off;
    14.         //Turn on automatic touch detection
    15.         NatCam.DetectTouchesForFocus = Switch.On;
    16.         //Set the RawImage's texture to the camera preview
    17.         previewUIPanelRawImage.texture = NatCam.Preview;
    18.         //NatCam.PhotoSaveMode = PhotoSaveMode.SaveToPhotos;
    19.      
    20.     }
    21.     public void CaptureImg()
    22.     {
    23.         Texture2D frame = NatCam.PreviewFrame;
    24.         byte[] byt = frame.EncodeToPNG();
    25.         Destroy(frame);
    26.         File.WriteAllBytes (string.Format ("mnt/sdcard/dcim/{0}.png",System.DateTime.Now.ToString("yyMMddHHmmss")), byt);
    27.     }
    "CaptureImg" is called by a button clicked event. The unity version is 5.3.4f1.

    Is there anything wrong?
     
    Last edited: Jun 2, 2016
  5. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi @charyyc you are using NatCam v1.1. The instructions I gave you are for v1.2. You should update to v1.2. Download the update from the Asset Store. It contains a ton of bug fixes. But in v1.1, this is how to set photo save mode:
    Code (CSharp):
    1. NatCam.Initialize(PhotoSaveMode:PhotoSaveMode.SaveToPhotos);
     
  6. charyyc

    charyyc

    Joined:
    Jun 1, 2016
    Posts:
    10
    How to use it in AR scene?
     
  7. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    How do you mean?
     
  8. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    I thought I'd give an update on things.

    We are planning NatCam v1.3. Features planned include:
    - Face detection.
    - Setting photo resolution using DeviceCamera.SetPhotoResolution +1 overload.
    - Barcode detection for all platforms.
    - Updating Readme.pdf
    - Bug fixes as usual

    We are also debating adding exposure controls to this list, but this will come with one major drawback: dropping support for iOS 7. The choice is yours.

    I'd also like to talk a little about NatCam. NatCam was developed to fix the problem so many of us face. But the fix is being fixed itself. NatCam isn't perfect. It has issues that are sometimes beyond us--especially on Android. To get a sense of how broad the issues are, type 'android camera not working site:stackoverflow.com' into Google and see how many results come up. Compare that to the number of results that come up when you type this: 'ios camera not working site:stackoverflow.com'. I have 956,000 for Android vs 188,000 for iOS.
    Although the vast majority of NatCam developers are excellent to work with, it is imperative that everyone understands that it requires a lot of communication to get NatCam completely stable. The reason NatCam was priced at $50 is so that developers become invested in making NatCam work perfectly for them, not just buying some asset on the asset store and burying it. I try my best to provide excellent support for it. If you do purchase NatCam and encounter an issue, please email me. If you purchase NatCam and it works perfectly, please email me. My goal is not just to provide a camera API, but to ensure that its functionality is maximized by developers. I'd like to ask that current NatCam devs leave an honest review on the asset store page if you haven't already. It is important for other developers to understand what they will be getting, and for us to improve. Finally, I'd like to say a big thank you to the 100+ NatCam developers out there. Make a great app!

    Lanre.
     
    Last edited: Jun 3, 2016
    Cromfeli likes this.
  9. Cromfeli

    Cromfeli

    Joined:
    Oct 30, 2014
    Posts:
    198
    Would be very nice to have exposure controls.

    "Finally, I'd like to say a big thank you to the 100+ NatCam developers out there. Make a great app!"

    Lanre & co keep up the great work :)
     
    Last edited: Jun 3, 2016
  10. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Thanks @Cromfeli ! I have added a poll at the top of the page for exposure controls. It will be open for 1 week. Cast your vote!

    EDIT: I voted yes by the way.
     
    Cromfeli likes this.
  11. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    We are adding barcode detection to ALL platforms. So if you ever need barcode detection, NatCam will be your all-in-one solution, whether you develop for iOS or Windows. This will especially appeal to the ZXing.NET devs and those who just want to detect a barcode in the editor without building to the device.

    Version 1.3's list is growing, so please, if you have any feature requests, now is the time to let me know.
     
    Last edited: Jun 3, 2016
  12. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    I come bearing news:

    NatCam v1.3 may not include the native rendering pipeline.

    We might have just found a way to access the camera preview without having to manually handle and process YUV data. This would mean that NatCam will be reverted to using BGRA on iOS (which means we lose the memory savings), but it will significantly improve performance for GPU bound applications. Of course, this will also mean that developers will not be able to access Y and UV buffers of the camera preview, and will be limited to BGRA/ARGB. This will also mean enhanced stability on Android since the bugs we are currently tracking stem from the rendering pipeline. I'll keep this post updated.
     
  13. PrisedRabbit

    PrisedRabbit

    Joined:
    Aug 14, 2012
    Posts:
    57
    Hi, _width and _height symbols in NatCamRendering.mm conflict with same symbols from FacebookSDK. Just renamed to _widthh and _heightt and all ok.

    About asset: It's great and I recommend it!
     
    Last edited: Jun 6, 2016
    Lanre likes this.
  14. TapdnCwong

    TapdnCwong

    Joined:
    Aug 12, 2015
    Posts:
    2
    Is there minimum software and hardware requirements for the Barcode detection?

    The following android devices successfully initialize Natcam Camera, but fails to initialize the barcode detector.
    "NatCam Error: Failed to initialize barcode detector"

    Samsung Tab SM-T700, Android version 5.0.2
    Motorola Moto X 1st Generation, Android version 4.4.4
     
  15. piacentini

    piacentini

    Joined:
    May 27, 2014
    Posts:
    28
    I believe Barcode detection in Android requires GooglePlayServices > 7.8 APK installed/updated on your device. This works even with Android 2.3 (I know I tested it with Android 4.1, updated version of GPS). Notice that NatCam does include its copy of GPS 7.8, but the device has to have the same (or greater) version of the APK, which is typically autoupdated by Google (but not on our test devices).
    A check for this condition should probably be added to Natcam, Lanre? This would help a lot since we could inform users that they need to update GPS if we detect this condition AND need to use Barcode detection.
     
    TapdnCwong and Lanre like this.
  16. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    As a professional photographer and questionable Unity developer. I am very pleased and excited to purchase this asset!! Keep up the great work....and give us exposure control.
     
    Lanre likes this.
  17. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    You're 100% correct. NatCam v1.3 will include a check and possibly a way to force Android to update its version of google play services.
     
    TapdnCwong likes this.
  18. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Thank you! Exposure control has been added to NatCam v1.3b0 but we aren't giving out the beta until we implement a new, low-cost rendering pipeline.

    P.S.: Sorry for the late response guys, my internet has been out for 4 days.
     
    Cromfeli and pixelsteam like this.
  19. AWE_liam

    AWE_liam

    Joined:
    Jun 8, 2016
    Posts:
    1
    This API looks like it will be the right fit to tackle the roadblock with a current contract. The main thing we need it for though is Video Capture, which I see is an upcoming feature. Can you give a ballpark of when that feature will be available, and maybe what kind of file saving interface it would have? Also, with the NatCam.SetResolution() function, is there and option for specific numbers like x pixels by y pixels, and would you be able to capture video in a custom aspect ratio like that in the future (to capture say widescreen footage, academy etc)? Sorry for the barrage of questions please answer what you can.
     
  20. TapdnCwong

    TapdnCwong

    Joined:
    Aug 12, 2015
    Posts:
    2
    Thanks Lanre and pixelstream, I'll keep this in mind for our Android Apps. Look forward to the new updates!
     
    Lanre likes this.
  21. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi! We don't have an ETA for video capture. This feature is on the sometime-in-the-foreseeable-future roadmap, along with OpenCV examples. I haven't given the file-saving interface much thought, but I am sure that we will implement a way to save to the app's private storage, and an option to write to the camera roll.

    With SetResolution, there is a way to define the pixel dimensions you would like. Resolution presets simply provide this very function with corresponding integer values (like ResolutionPreset.FullHD translating to 1920x1080). See the documentation under DeviceCamera>SetResolution (2nd overload). You must note that the camera might not conform to the size you specify, but will always pick a resolution that it supports which is closest to what you specify. So if you call DeviceCamera.SetResolution(1920, 1070), the camera will use FullHD and not your resolution.
     
  22. ericalan

    ericalan

    Joined:
    Jun 10, 2016
    Posts:
    17
    Hi Larne,

    You mentioned that "NatCam.Preview is an external texture now, so all calls that require access to texture data in system memory (like GetPixel(s)(32), SetPixel(s)(32), and EncodeToJPG/PNG) will fail."

    We are using the WebCamTexture at the moment but it has it's limitations. So if we switched to NatCam and wanted to save a photo to a Texture2D in memory without saving it to the device (obviously using the PhotoSaveMode.DoNotSave option) will we be able to convert it to a byte array if we used NatCam without using GetPixles / SetPixels?
     
  23. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    @lulzbane . Yes, you will be able to access the preview data:
    Code (CSharp):
    1. Texture2D frame = NatCam.PreviewFrame;
    NatCam.PreviewFrame essentially does what NatCam did before: getting the preview data in the managed layer. This way, the texture is usable like any other Texture2D. There is one caveat: memory consumption. Each call to this property would allocate a new Texture2D so you have to be very careful with memory management. We included a macro that allows NatCam reuse an already-allocated Texture2D instead of allocating a new one to make memory management less of a nightmare:
    Code (CSharp):
    1. #define ALLOCATE_NEW_FRAME_TEXTURES //Comment to make NatCam reuse instead of realloc
    So in your case, you can save a 'screenshot' of the preview by calling:
    Code (CSharp):
    1. Texture2D frame = NatCam.PreviewFrame;
    2. byte[] png = frame.EncodeToPNG();
    3. SaveToFileSystem(png);
    4. Destroy(frame); //This won't be necessary if you comment the aforementioned macro
    But if you want to take an actual photo as you mentioned in your post, like a normal camera app, do this:
    Code (CSharp):
    1. NatCam.CapturePhoto((Texture2D photo) => {
    2. //Do stuff with the photo
    3. //This texture is ALWAYS readable. Get/SetPixels/Encode will always work here
    4. });
    The reason we removed access to the preview data from the managed C# layer was for a performance and memory optimization. Most of the time, developers wouldn't need to access the pixel data each frame except they were using OpenCV, which is already handled internally by NatCam. If they ever needed to manually handle the pixel data, then they would be better off (performance wise) doing so in a native layer (native C++ on Android or Obj-C on iOS). So we decided to keep the pixel data in the native layer and provide an easy way of accessing it (OnNativePreviewUpdate event in NatCamNativeInterface).

    See the NatCam documentation which explicates more.
     
  24. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Exposure Controls it is! Thank you to the developers that voted.
     
    Cromfeli likes this.
  25. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Hi Lanre !
    First, thank you so much for this amazing library :)

    I'm trying to save a photo with the following code on android:

    Code (CSharp):
    1.     public void CapturePhoto () {
    2.         if (checkIco.gameObject.activeInHierarchy)
    3.         {
    4.             SaveImg();
    5.             OnCheckedPhoto();
    6.             return;
    7.         }
    8.         NatCam.CapturePhoto(OnCapturedPhoto);
    9.     }
    10.  
    11.     public void SaveImg()
    12.     {
    13.         string pictureName = "test.jpg";
    14.  
    15.         Texture2D frame = NatCam.PreviewFrame;
    16.        
    17.         byte[] byt = frame.EncodeToJPG(80);
    18.         Destroy(frame);
    19.        
    20.         string cheminGallerie = Application.persistentDataPath+"/Gallerie";
    21.        
    22.          if(!Directory.Exists(cheminGallerie))
    23.         {  
    24.          Directory.CreateDirectory(cheminGallerie);
    25.         }
    26.    
    27.         File.WriteAllBytes (cheminGallerie + "/" +pictureName, byt);
    28.     }
    It's working well when the smartphone is in Landscape orientation.
    However when it is in portrait mode, the saved picture is really streched.

    It there a workaround to specify either you are in Landscape or in Portrait to force the good resolution ?

    Thank you !
    Seb
     
  26. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hmm. Add this debug log line:
    Code (CSharp):
    1. Texture2D frame = NatCam.PreviewFrame;
    2. Debug.Log("Frame is "+frame.width+"x"+frame.height);
    Then run it in landscape then portrait and let me know what it logs. I suspect that the height and width aren't switched when the orientation is portrait. There is no way to force NatCam to conform to a specific orientation.
     
  27. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Ahmm I can't see the log because for some reason "adb connect" is not working on my computer :/
    But you are right the height and the width aren't switched.

    Is there anything to do ?
     
  28. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Hi again Lanre,

    Sorry to bother you again but I spotted a strange little bug with the NatCamPreviewScaler script:
    • Select the Preview gameObject from the example
    • Set the NatCamPreviewScaler's scale mode to something that is not "none" (Fill screen...)
    • Build and run the scene to an android device
    • Rotate your android device in Landscape and look at a circle somewhere in your room (for instance)
    • Press the blue button to make a screenshot's preview
    • Press the blue button once again in order to come back to the camera mode
    • In camera mode, have a look once again to the circle in your room=> The circle is now displayed streched :/


    Seb
     
    Last edited: Jun 12, 2016
  29. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi @rattlesnake sorry for the late response. I will address the height/width issue in v1.3. As for the NatCamPreviewScaler, we will be rewriting it because it is buggy like you have described. Email me at olokobayusuf@gmail.com and I can send you the beta once it's ready.
     
  30. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    Hi Lanre !

    Thank you for your answer, I will be glad to test the beta :)
    Cheers,
    Seb
     
  31. ericalan

    ericalan

    Joined:
    Jun 10, 2016
    Posts:
    17
    Hello again, I'm trying to implement NatCam in our app and having a couple of issues.

    This is the initialization code:
    Code (CSharp):
    1. NatCam.Initialize(Interface: NatCamInterface.NativeInterface, PreviewType: PreviewType.Readable);
    2. NatCam.PhotoSaveMode = PhotoSaveMode.DoNotSave;
    3. NatCam.ActiveCamera = (DeviceCamera.RearCamera != null) ? DeviceCamera.RearCamera : DeviceCamera.FrontCamera;
    4. NatCam.ActiveCamera.SetResolution(ResolutionPreset.HD);
    5. NatCam.Play();
    6. View.texture = NatCam.Preview;
    When the preview texture is shown it shows only a plain white screen, this happens when I have the NatCamPreviewScaler and without it.

    If I take a photo (capture the PreviewFrame) it does capture from the camera but the image is rotated 90 degrees clockwise (this is using the phone model SM-J111F - Samsung J1 Ace Duo).
     
  32. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi! The preview stays white because prior to NatCam receiving the first preview frame, NatCam.Preview is null. So you are essentially setting View.texture = null. In order to set the view texture when the preview texture becomes available, use:
    Code (CSharp):
    1. NatCam.ExecuteOnPreviewStart(() => View.texture = NatCam.Preview);
    2.  
    3. --or--
    4.  
    5. NatCam.OnPreviewStart += () => View.texture = NatCam.Preview;
    Concerning the photo being rotated, we are working on a a fix for this in v1.3. It seems to be rotated wrongly on some devices, while being rotated correctly on others.
     
    Cromfeli and ericalan like this.
  33. ericalan

    ericalan

    Joined:
    Jun 10, 2016
    Posts:
    17
    Thanks, that worked :)
     
    Cromfeli likes this.
  34. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Cool :cool:
     
  35. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    963
    Can the save directly to ios or android photos directory be used with screenshots (not just from the camera feed) ?
     
  36. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Currently, no. But it has been added to the list for v1.3, thank you!
    Code (CSharp):
    1. NatCam.SaveToPhotos (Texture2D photo, PhotoSaveMode saveMode);
     
  37. ericalan

    ericalan

    Joined:
    Jun 10, 2016
    Posts:
    17
    Hello, I'm struggling to get the camera's focus to work.

    Despite the details below when the preview is showing no amount of tapping causes the camera to focus. The autofocus also appears to not be working. But I'll explain what I have done so far...

    I have added the Nat Cam Preview Gestures component to the RawImage game object, when I run the scene in the unity editor I can hit the breakpoints in the event methods (OnPointerUp, OnDrag, OnEndDrag) in the NatCamPreviewGestures.cs file by clicking in the scene, so it appears to be wired up correctly.

    In the OnDrag method the following code:
    Code (CSharp):
    1. if (!trackPinchGestures || NatCam.ActiveCamera == null || eventData.pointerId > 1) return;
    2. previous[eventData.pointerId] = eventData.position - eventData.delta;
    The assignment there for previous[eventData.pointerId] throws an exception because eventData.pointerId is -1 which is outside the bounds of the previous array.

    I noticed that there is a check in the first line that if the pointerId is greater than 1 to return, I have tried changing that to return if pointerId is less than 1 but that didn't help.
     
    Last edited: Jun 15, 2016
  38. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    For focusing to work, make sure the active camera's focus mode is set to FocusMode.TapToFocus or FocusMode.HybridFocus. What platform or device are you running on?

    Change the if statement to this:
    Code (CSharp):
    1. if (!trackPinchGestures || NatCam.ActiveCamera == null || eventData.pointerId < 0 || eventData.pointerId > 1) return;
    This way, you won't get the argument out of range exception. The code checks for only two touches, thus expects pointerID 0 and 1. I wonder why it returned -1 for you.
     
  39. ericalan

    ericalan

    Joined:
    Jun 10, 2016
    Posts:
    17
    I'm on windows 10, I have a notebook and there are 3 different pointer inputs, touch screen, trackpad and mouse... all of them end up with pointerId -1

    I've tried FocusMode.TapToFocus and FocusMode.HybridFocus but the phone's focus is still not working (including with the above condition added in).
     
  40. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    That doesn't sound surprising. I think it's safe to assert that only iOS and Android API's expose 'pointerID' (touchID) because they are based on touch input. On Windows, there won't be need for tracking multiple 'fingers' on screen. Gestures tracks two fingers simultaneously to calculate the magnitude of pinching. On a mobile device, it would work as expected.

    What phone are you using? Is it Android or iOS? Also, make sure that the camera actually supports whatever focus mode you set it to; NatCam doesn't throw any errors or warnings if setting the focus mode (or any other DeviceCamera property) fails, it simply preserves whatever value was there before. So if setting the focus mode failed, checking DeviceCamera.FocusMode will be the same thing that it was before you called DeviceCamera.FocusMode = FocusMode.FocusMode.
     
  41. ericalan

    ericalan

    Joined:
    Jun 10, 2016
    Posts:
    17
    The device is an Android device, Samsung J1 Ace Duo, the camera normally has tap to focus and autofocus when using the built in camera app.

    I did try the flash and the flash does work through NatCam but not the focus.
     
  42. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Sounds like I'll need the logs to address this one. Can you deploy onto the device and email me the full logs from logcat (don't filter out Unity log tags). Thank you.
     
  43. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi guys! We would like to ask for developers who would like to test NatCam v1.3b0 as we're about 1 day away from completing it. We would especially like to ask for developers with Nvidia Shield tablets, as previous versions of NatCam haven't been reported to work well. We believe the new rendering pipeline should fix compatibility with Shield.

    NatCam v1.3b0 features include:
    + Added Exposure control with DeviceCamera.SetExposure(float), DeviceCamera.MinExposureBias and DeviceCamera.MaxExposureBias.
    + Added ExposureMode enum and DeviceCamera.ExposureMode.
    + Added Face detection with Face struct and NatCam.RequestFace().
    + Added DeviceCamera.SetPhotoResolution() + overloads.
    + Added DeviceCamera.ActivePhotoResolution.
    + Added a new, low-cost rendering pipeline on Android.
    + Removed rendering pipeline on iOS. This has increased performance especially for GPU-bound applications.
    + Barcode detection now supports Unicode characters.
    + Made camera switching faster on Android.
    + Reimplemented NatCamPreviewScaler to be more stable.
    + Added check and error logging for google_play_services when detecting barcodes and faces on Android.
    + Fixed bug on Android where camera must be manually focused before autofocus starts.
    + Fixed bug where NatCam becomes unresponsive when there is no camera in the scene.
    + Removed Verbose switch from NatCam.Initialize(), it is now a member variable (NatCam.Verbose = ...).
    + Deprecated BarcodeDetection switch in NatCam.Initialize() for MetadataDetection (which now includes faces).
    + Changed OnDetectedBarcode delegate template to take single barcode instead of list.
    + Fixed FormatException when scanning some barcodes.

    Please email me at olokobayusuf@gmail.com if you are interested in testing the beta once it is ready.
     
  44. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi guys. I wasn't able to meet the deadline for v1.3b0; I broke the preview orientation after implementing the new rendering pipeline on iOS and Android. As a result, we are delaying giving it out till Monday.
     
  45. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    NatCam v1.3b0 si on track for release this evening. In other news:

    Unitygram is coming to the asset store for free.

    Using the features in NatCam v1.2, and those added in v1.3, Unitygram will be a minimalist camera app that supports photo capture, barcode recognition, face tracking, and more. I will announce when it gets released.

    Also, we have decided to increase NatCam's price to $75 as we planned a long time ago. This will start when we launch NatCam v1.3, so now is the time to buy NatCam from the Asset Store. The upgrade from v1.2 to v1.3 for current customers will be free as it has always been.
     
  46. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    963
    I'm actually looking for a plugin simply for saving screenshot to iOS native photos. Please also add the feature of not loading the camera, opencv other stuff if it's not called/referenced/needed in code!
     
  47. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hmm. I've been doing some research on this and have found this asset on the Asset Store. If you only need to save a screenshot to the gallery, then there's no use getting an asset like NatCam.

    There's no way I can strip NatCam's code when building. It is already small enough, and you can simply not use the camera in your code.
     
  48. Twelv445

    Twelv445

    Joined:
    Feb 22, 2013
    Posts:
    30
    Just wondering if there is a demo .apk I can try on my android device for NATCAM?
    Just want to test the barcode scanning before I purchase :)

    Thank you!
     
  49. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,662
    Hi! I have emailed you the APK. I will be adding an APK download link to the asset store page.
     
  50. Twelv445

    Twelv445

    Joined:
    Feb 22, 2013
    Posts:
    30
    Thank you and I must say this works amazingly - far better than many many barcode scanner assets I have used before :)
     
    Lanre likes this.
unityunity