FLIR One Developer / Blog / Topics / mobile / getImage() returns nil on FLIRThermalImage

getImage() returns nil on FLIRThermalImage

Home Forums FLIR ONE SDK Development iOS development Installation and getting started getImage() returns nil on FLIRThermalImage

Tagged: 

This topic contains 19 replies, has 2 voices, and was last updated by Profile photo of Scott Scott 3 weeks, 4 days ago.

Viewing 20 posts - 1 through 20 (of 20 total)

  • Author

    Posts

  • #10338

    Profile photo of Scott
    Scott

    Participant

    I’ve run into an issue when adding support for FLIR One to a large Objective-C / Swift app. The camera object returns an instance of FLIRThermalImage when imageReceived() is called on its delegate, but calls to getImage() on the thermal image return nil. Calling getPhoto() *does* work correctly. I get the exact same behavior with the emulation (the instance of FLIRThermalImage returns a photo, but not an image.)

    What’s odd is that a bare bones Swift project I setup does work correctly. And I’ve tried adding one additional Objective-C class to the project to trigger adding a bridging header, etc. – which had no impact (it still returns IR images from the thermal image.)

    Returning a photo but no image seems to be significant result, so I’m hopeful this is a known issue or someone can point me in the right direction.

    I’m using the latest SDK released on the 4th with Xcode 10.2 across multiple devices running iOS 13 / iOS 12.x.

    #10340

    Profile photo of Scott
    Scott

    Participant

    I’ve been able to reproduce the problem in my bare-bones Swift test app by integrating the MapBox SDK and adding a map to the same view controller.

    #10341

    Profile photo of Scott
    Scott

    Participant

    I have a sample project I can provide to reproduce the issue. Essentially, I took the storyboard from the sample app from the SDK, added it to a Swift project, then reimplemented the view controller in Swift.

    When an MGLMapView is instantiated programmatically after a 10 second delay, the IR image stream freezes.

    #10973

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    Hello Scott, may I verify that your SDK version and your camera version are the same? If they are not the same version it has been known that such a combination can cause nil instances of getImage().

    #10974

    Profile photo of Scott
    Scott

    Participant

    I’m not sure what you mean by camera version. Do you mean the version of the camera hardware? If so, where can I find the version number and which are compatible?

    Also, getImage() works – unless there is an instance of MGLMapView (from the Mapbox SDK) in the view hierarchy. If the discrepancy between versions always results in a nil image, it sounds like we have a different issue.

    #10975

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    Assuming your versions are the same, I think your first step would be to verify that the thermal image is being saved in the correct directory within your application. I have a hunch that the reason your thermal image is not being saved is that for some reason it isn’t being saved to a particular directory you’re calling to display the image. Try explicitly saving the thermal image in your app with code such as:

    – (IBAction)capturePhoto:(id)sender {
    self.cameraBusy = YES;
    [self updateUI];

    NSURL *filepath = [[FLIROneSDKLibraryManager sharedInstance] libraryFilepathForCurrentTimestampWithExtension:@”png”];

    [[FLIROneSDKStreamManager sharedInstance] capturePhotoWithFilepath:filepath];

    }

    And use

    [[FLIROneSDKLibraryManager sharedInstance] libraryFilepathForCurrentTimestampWithExtension:@”png”];

    to pull the photo from the exact directory. Display this image. If this does not work, further debugging will be necessary.

    #10976

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    Oh sorry Scott, I didn’t see your reply. Let me get back to you ASAP.

    #10977

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    I’m sorry I should have been more clear. Do you know if your Flir one is gen 1, gen2, or gen3? If the SDK is a different generation it has been known to have nil occurrences.

    #10978

    Profile photo of Scott
    Scott

    Participant

    I’m trying to display the thermal image we get from the imageReceived callback from the camera for display on screen. This corresponds to this method in the sample project…

    - (void) imageReceived {
        dispatch_async(dispatch_get_main_queue(), ^{
            [self->camera withImage:^(FLIRThermalImage *image) {
                self->imageview.image = [image getImage]; // this returns nil
            }];
        });
    }
    

    #10979

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    So just to confirm, I’m assuming your SDK generation is the same as your camera version? So we can pinpoint the problem. I”ll take a look at your code too.

    • This reply was modified 2 months, 1 week ago by Profile photo of Justin Tjoa Justin Tjoa.

    #10981

    Profile photo of Scott
    Scott

    Participant

    We seem to have the device depicted here: https://www.flir.com/products/flir-one-gen-3/

    #10982

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    I see, it is a generation three. Sorry didn’t see your reply. So I take it your SDK is also version 3? Can you post a link to the SDK you downloaded? Or if you can find the generation tell me what generation the SDK was?

    • This reply was modified 2 months, 1 week ago by Profile photo of Justin Tjoa Justin Tjoa.

    #10984

    Profile photo of Scott
    Scott

    Participant

    To clarify, I am able to receive images with our device and the latest SDK. I’m having what appears to be a conflict with another third party library that uses OpenGL to display vector maps.

    Nil is only returned *if* a Mapbox map view is in the view hierarchy. If I do not add a map view or create one but do not add it to the view hierarchy, I receive thermal images as expected from the getImage method.

    I’m trying to narrow down where the issue is. I suspect it has to do with the rendering code in Mapbox’s map view, but they do not have hardware to test with.

    #10985

    Profile photo of Scott
    Scott

    Participant

    We’re using the latest SDK [FLIR Mobile SDK : Apple iOS SDK 1.0.5] as I was unaware of any compatibility issues between hardware and version of the SDK. Are they not backwards compatible?

    #10986

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    Hello Scott, so based on the method you posted for displaying image it seems that you are using Mobile SDK, NOT the Flir ONE SDK. Please correct me if I’m wrong. Assuming you are using Mobile SDK (which is version 3), and are using a gen 3 hardware, it doesn’t seem the mismatch is the issue. I’ll look deeper into the issue and let you know if I find a solution. I’ll potentially escalate the matter if I can’t find a solution. The version 3 SDk was released on Nov 1, so please ensure you’re using that version with the generation 3 device.

    They are not backwards compatible.

    • This reply was modified 2 months, 1 week ago by Profile photo of Justin Tjoa Justin Tjoa.
    • This reply was modified 2 months, 1 week ago by Profile photo of Justin Tjoa Justin Tjoa.

    #10988

    Profile photo of Scott
    Scott

    Participant

    We’re using the SDK from here: developer.flir.com / mobile / flirmobilesdk /

    #10991

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    Hello Scott, I spoke with our staff and it seems that we will need to escalate the matter to the Mobile SDK team. I cannot guarantee the use of third party libraries with OpenGL will work, but the team will look into the matter. I will forward this forum chat to the team.

    #10992

    Profile photo of Scott
    Scott

    Participant

    Thanks Justin.

    I can provide a bare-bones sample project that reproduces the issue if that helps.

    #10993

    Profile photo of Justin Tjoa
    Justin Tjoa

    Participant

    Thank you Scott. yes I may need it. I will reply to this post if I do. Our team who developed the Mobile SDK probably has all the details they need from this forum, but I”ll let you know if we need any more information.
    Cheers!

    • This reply was modified 2 months, 1 week ago by Profile photo of Justin Tjoa Justin Tjoa.
    • This reply was modified 2 months, 1 week ago by Profile photo of Justin Tjoa Justin Tjoa.

    #11295

    Profile photo of Scott
    Scott

    Participant

    Hello Justin,

    Has there been any updates on this issue?

    Thanks,

    – Scott

Viewing 20 posts - 1 through 20 (of 20 total)

You must be logged in to reply to this topic.