Did you know image processing is not only used for developing image editor’s but the ULTIMATE ninja application of image processing is detection and localization of particular region or object in an image …heavy words ? don’t get it ? keep calm and stick with me 😎.
warning 202 volts : If you are a new member i suggest you to read part 1 !
Ok so far we have learnt about images , and what are they made of…but lets really dig into what is image processing.
The Mystery of RGB
Now as you know each pixel is made up of a color code which follows a format ( R , G , B ) with different values of r , g , b giving different colors…to help you understand the Mystery matrix of RGB… lets consider a rubiks cube
it looks something like this right ?
Now consider a face of rubiks cube … choose any face doesn’t matter which , now what i want you to imagine is the face of the rubik’s cube being 2D is one pixel of the image … something like this
in this top view of two cubes consider the top view of first cube (face) as pixel 1 – which has the color red (255,0,0) and face of the cube 2 as pixel 2 has green color (0,255,0)
now as you twist the cube you may get different color’s how ? consider there are different colors on the cube what happens if you mix them ? you get a different color right ? its like painting… you take different colors and mix them in different ways you get different colors.
But the idea behind explaining this whole stuff was …a pixel is like a cube which shows only one face(2D) but in reality its 3D …its a 3 dimensional matrix of different color’s . And now if you take a look at the color code — (R , B , G) you understand that its the value of ( X axis , Y axis , Z axis ) ! Voila you have just learned something new ! i know the feeling 😎
Image detection and Localization
Consider a example
A human wants a coin which is kept on table , now there are many different things on the table but he accurately picks up the coin ? so at this point not to make it boring anymore – we conclude that the human can differentiate between two or more things, but can a computer do that ? … we probably don’t need IQ level – 400 here to tell the answer is ” YES “
as a programming perspective if i gave you a image of a coin on a table(Consider the above image of the coin)…and tell you to locate the coin using image processing how will you do it ? now as you know about pixels you can simply make a program which can find the coin using by looping all the coordinates of the image starting from (0,0) to the ending (x,y) of the image and then using if condition — like ” if you find the color yellow then convert that pixel to green ” so it will change the color code of the pixel whenever a yellow pixel is found ? right ? so it will ultimately tell you where is the image ? ! and now you can set the condition — ” if you find the pixel == yellow && if it is the first yellow pixel then save its coordinate to a var ” so you get the coordinate of the first pixel and similarly all coordinates ! … but this is not a effective method though important to understand image processing.
and the processed image would look something like this…
So this is all for today ! i hope you like it …
In the next post i will be opening the box of real world practical python and openCv so keep following
If you have any doubts related to this … you can always ask your questions in the questions forum ! but make sure you make a account first !