So let's get into some arithmetic operations using open.
So what arithmetic operations are they basically adding matrices to imagery and by adding mistresses
or subtracting matrices from or imagery.
It has the effect of increasing brightness or decreasing brightness or intensity.
So to do that we actually have to first create the matrix that we want to add subtract to our image
and non-pay has actually has built in functions one called empty ones.
This allows us to create an array which is of this dimension which is same dimensions as image here.
And we ascended and type to unsane and to get it which is what open CBEST uses to store or image data
and we multiply by Escuela 75.
So if we wanted to see what this looks like let's just copy this line here.
And run it separately in a different cell.
And it's actually just printed here and there we go.
So as we see these images of matrix of 75 and here of course the same dimensions as this image here.
So using the CV to the add function it adds these two matrices here.
Other uses function this and this image or I should say has to have to seem them actions which is why
we follow and copied it into this one function here.
And likewise we do it with the subtraction function here.
So let's see how this looks when we actually run this function.
There we go.
This is a darkened image here substantially darker.
And this is a and image here.
What's important to know is that let's say we did a 175 here.
What do you think would have happened with certainty.
This one is even darker which means that volumes are less big.
Bigger than 175.
These are the only ones that show up not because everything else cost to zero which is why it's black.
And similarly there's a lot of white points or very light coats here.
What happens is that when you add 175 to these points it actually reaches 255 which is white as you
can see sort of has the effect of clipping highlights in some areas here.
Please know that we can't ever exceed 0 and 255.
So whether we're adding when we're adding literacies to imagery.
Keep that in mind that you will get some clipping which is what we saw in the black and white images
here.
So let's start doing some bitwise operations and icle and device operations and masking because that's
essentially what you'll be using these bitwise operations for.
They're quite handy when you have to mask images which you will see later on in this course.
But for now we'll just enjoy this topic.
So firstly let's create some cheaps here.
So we're going to create a square and an ellipse here.
Now you may be familiar with creating a rectangle or square I call it because it's seem that mentions.
I for this one.
However an ellipse is slightly different.
It doesn't actually follow the same standard as a sicko.
You can check the weapons in the documentation to get some details and one go into it in this chapter
here.
It's taken too much time.
Let's just run this function and we see it here.
So elipse are single efforts and has actually not a full of study parameters to create sort of a semi
hemisphere type image here.
So what we're going to do know we're going to overlay these images and using some bitwise operations
to illustrate the different type of operations that we have.
So let's get to it.