Camera Declaration/Initialization

I know there are lots of threads on the camera, but i havn’t seen any on this topic specifically.
I’m just wondering how to declare/initalize the camera in an Iterative Robot based program.
Because (correct me if im wrong) you have to use AxisCamera &camera = AxisCamera::GetInstance(), the &camera is a reference, and MUST be initialized when it is declared.
If i put this line of code in the constructor, or TeleopInit, the reference can’t be accessed in any other function.
If i put it in TeleopPeriodic, I will be able to access the camera reference where i need it, but it will be inneficiently called every loop

What is the best, or atleast a working way to get a working variable/reference of the camera that i can access in TeleopPeriodic for tracking?

Has anybody gotten the camera feed and tracking to work in iterative robot?

Yes. We resorted to a global variable so above our robot declaration we have:

AxisCamera &g_camera = AxisCamera::GetInstance();

class Robot281: public IterativeRobot {
etc.
};

put it in the class:

public yourrobot:public IterativeRobot
{
...
     AxisCamera &cam;
public:
    yourrobot():
...
      cam(AxisCamera::GetInstance())
      { }

....
};