Welcome back.
We talked about the camera controller.
Now under this camera controller start with var detection results by.
Remember for saving along the camera compositions and empty list of detection results.
Alt+.
Enter to import the detection result and the by operator.
Then we need to create another variable called object detector.
Listener equals to remember it's of type object and the detection listener that we created before containing
two functions on error and on result.
So here we need to implement the on error and on result and on result.
At first we have the on error.
So log v set tag and detection listener error.
Then we have the on result.
Pass the result a list of detection result, image size, image height and the rotation and set the
detection results equals to the results.
It's very simple.
We are just creating this object.
And we talked a lot about those in the previous videos okay.
Implement the members.
And here we have the on results.
So there is an error.
Let me check like this Okay, so we remove this, uh, additional curly braces.
Okay.
So here we are creating an instance of this listener object detector listener passing the onerror and
on results functions.
Okay.
It's very simple.
Now let me create another object val object detector by remember same way.
Mutable state of object detector helper.
Helper class that we created before.
And we need to pass two parameters the context and the listener.
The context is created before and the object listener that we created just now.
Okay.
So let me pass this object detector listener and paste it here.
We have an error because we need to add this curly braces to close this variable.
So here everything is working fine.
Okay so this is the object detector.
We create a mutable state of object detector helper class and pass the context and the object detector
listener that we created before.
Those are the variables that we need to use in the next video.