WEBVTT

00:00.080 --> 00:00.960
Welcome back.

00:01.000 --> 00:03.240
We talked about the camera controller.

00:03.280 --> 00:09.960
Now under this camera controller start with var detection results by.

00:10.000 --> 00:16.680
Remember for saving along the camera compositions and empty list of detection results.

00:16.720 --> 00:17.240
Alt+.

00:17.240 --> 00:21.040
Enter to import the detection result and the by operator.

00:21.160 --> 00:25.800
Then we need to create another variable called object detector.

00:25.960 --> 00:34.960
Listener equals to remember it's of type object and the detection listener that we created before containing

00:35.000 --> 00:37.760
two functions on error and on result.

00:37.760 --> 00:44.360
So here we need to implement the on error and on result and on result.

00:44.360 --> 00:47.080
At first we have the on error.

00:47.320 --> 00:53.840
So log v set tag and detection listener error.

00:53.960 --> 00:56.840
Then we have the on result.

00:56.880 --> 01:04.160
Pass the result a list of detection result, image size, image height and the rotation and set the

01:04.160 --> 01:06.880
detection results equals to the results.

01:07.120 --> 01:08.240
It's very simple.

01:08.440 --> 01:10.720
We are just creating this object.

01:10.720 --> 01:14.960
And we talked a lot about those in the previous videos okay.

01:15.000 --> 01:16.280
Implement the members.

01:16.600 --> 01:18.760
And here we have the on results.

01:18.760 --> 01:20.400
So there is an error.

01:20.440 --> 01:27.100
Let me check like this Okay, so we remove this, uh, additional curly braces.

01:27.140 --> 01:27.580
Okay.

01:27.660 --> 01:34.420
So here we are creating an instance of this listener object detector listener passing the onerror and

01:34.460 --> 01:36.500
on results functions.

01:36.540 --> 01:37.020
Okay.

01:37.260 --> 01:38.420
It's very simple.

01:38.700 --> 01:47.580
Now let me create another object val object detector by remember same way.

01:47.860 --> 01:52.060
Mutable state of object detector helper.

01:52.100 --> 01:54.740
Helper class that we created before.

01:54.740 --> 01:58.380
And we need to pass two parameters the context and the listener.

01:58.420 --> 02:06.540
The context is created before and the object listener that we created just now.

02:06.660 --> 02:07.180
Okay.

02:07.540 --> 02:13.700
So let me pass this object detector listener and paste it here.

02:13.700 --> 02:21.220
We have an error because we need to add this curly braces to close this variable.

02:21.380 --> 02:24.100
So here everything is working fine.

02:24.140 --> 02:26.580
Okay so this is the object detector.

02:26.780 --> 02:34.540
We create a mutable state of object detector helper class and pass the context and the object detector

02:34.540 --> 02:37.380
listener that we created before.

02:37.580 --> 02:42.700
Those are the variables that we need to use in the next video.
