Today you worked on processing frames or videos with open.
Now your task for today's exercise is to create this web app.
I'll show you some code to get you started, though, because this contains something that we haven't
covered yet.
So in this video, I'll cover that aspect as well.
But first, let's demonstrate the app how it works.
So if the user presses a start camera, then the user shows up.
And so the idea is that your task is to create this app, but also to add this date the day actually
of the week and the current time, which is still ticking.
So a sort of timed video camera, right?
So let me go to pie chart.
And I want to show you a simple version first.
So this is not the solution.
The solution is a bit more complex.
This code here.
What it does is this Let me execute it stream.
Let's run.
So we're using stream lit here.
And this script is named Simple dot p y.
So run simple that p y.
This app is a bit simpler than the one I just showed you, because when the user starts a camera, the
video shows up.
But this time in here, you see it's Hello.
It's not the date.
So this is a bit simpler.
So this app is constructed by this code.
So we've got this motion detector title and start camera and button.
And so if the user presses that start button, that means the start button has a value.
So if starts, if the button has been pressed, then we prepare an image with stream lead.
So see that image with this list?
As inputs.
So this will be like a placeholder where you inject the frames of the video, then you start open CV.
So previously in the course we did cover a simple app with with stream leads.
So stream leads can also do this the other way without using OpenCV.
But when you use OpenCV, you have more control over the frames, so you're working on a lower level
code so you have more possibilities.
What you can do with your code, as we do in this example, where we will write some text in the image
and you can also write dates and times, which is your task for the day.
So if the user presses the start button, then we construct the wild loop, as you know.
So we read the frame from this.
You can call this camera or video, whatever you like.
Then the frame is converted to color.
BGR to RGV.
I wanted to show you this technique as well.
You don't have to use it, but if you ever want to convert the channels from BGR, which is the standard
of OpenCV and you want to have the frames in RGV instead, then you can use this code.
So every frame will be updated to the current frame, but with our gbps.
So that means then if you give some colours, for example, we give the colour of text here, that means
20 is four or so for four reds and 100 is for green and 200 would be the amount of blue.
So this is optional, but just be aware that if you change that you should supply the numbers in the
correct order in our GP.
So that's is the code that writes text in frame.
It has these arguments.
I think these are self explanatory.
So that's a frame and that's a text you want to write that the coordinates of the image, they start
from the upper left corner of the image.
So if you're saying 50 here, that means.
We are 50 here.
So from the left border to the texts and the other 50 is from the upper border up to the text where
it begins.
That's the idea here.
Then we have the fonts and we have the font scale.
How big you want the font to be.
You can experiment with numbers.
That is the color of the text.
That is the thickness of the text.
That's the line type used to draw the text by OpenCV.
And then inside this wild loop we write the frame.
So your task now is that instead of showing how low you should show that dynamic day and the current
time, just as I showed you in the first demonstration in this video.
So thanks and see you later.