Why is the processImage delegate not getting called automatically?

asked 2020-12-02 16:22:39 -0500

Hi OpenCV Community,

I hope everyone is well and safe!

In a native iOS application written in Objective-C, I am able to track a red laser and get the coordinates; however, I am having problems with dropping this code into a native iOS plugin for Unity which is a static library.

With that said, I am able to successfully set up the CvVideoCamera in the static library and compile the Unity application without any errors, but the processImage delegate is not getting called automatically as it does in the native application.

Below, I attached and labeled relevant codes for the working native iOS application along with the static library.

Unity application compiled with static library - This number should ideally be 8 to confirm that the processImage delegate has been called; however, it remains 7 which only indicates that the camera is working. If I could get this working in the same manner as the native iOS application, I could send over the coordinates to Unity.

Static library - Override.h

Static library - Override.mm

Static library - Override.mm 2

Native iOS application - ViewContoller.h

Native iOS application - ViewController.mm

Native iOS application - ViewController.mm 2

If more information is needed, please let me know!

Best,

Steve

edit retag flag offensive close merge delete

Comments

U didn't called processImage or import processImage.

supra56 gravatar imagesupra56 ( 2020-12-03 08:06:24 -0500 )edit

I was under the impression that it gets called automatically if I am conforming to the protocol <cvvideocameradelegate> in Override.h. Additionally, I never had to call processImage in the native iOS application in order for it to run.

srsopoci gravatar imagesrsopoci ( 2020-12-03 09:31:20 -0500 )edit

the documentation for the Objective C bindings are very bare. unfortunately you are in uncharted territory. maybe this tutorial can help you https://docs.opencv.org/master/db/dc8...

crackwitz gravatar imagecrackwitz ( 2020-12-03 11:42:24 -0500 )edit