DEV Community

Cover image for NUMPY AND IMAGE MANIPULATION (part 2)
betpido
betpido

Posted on

NUMPY AND IMAGE MANIPULATION (part 2)

INTRODUCTION

In my previous post, I talked about what Numpy Arrays do and why they are popular in computer vision creation.

In this post, we are going to display a Numpy array as diagram so that it appears just like how a picture created from it would look like.

MAIN BODY

The numpy array diagram picture shown above is
Array = [ 4 , 7 , 3]. The picture shown is practically how numpy arrays or pixels work on screen.

As you can recall from my previous post, the array declared [4 ,7 , 3] is interpreted as:
a picture with a height of 4 pixels ,width of 7 pixels and each pixel has 3 RGB color values.

It can also be interpreted as:
a large 3Dimensional array which contains four 4 two-Dimensional arrays. Each of the 4 2D arrays has 7 rows (7 pixels). Finally each of the 7 rows has 3 RGB values. Remember that 3 rgb values come together to form a single color.

Therefore, each ROW in each ARRAY represents a particular PIXEL location. And the RGB values in that ROW represents the color of that PIXEL.

DIFFERENCE BETWEEN NUMPY ARRAYS(PIXELS) AND SPREADSHEET CELLS

In spreadsheet software such as excel, ROWS are arranged from top to bottom, likewise in Numpy, ARRAYS are arranged from top to bottom.

In spreadsheet, COLUMNS are arranged from left to right, likewise in Numpy, ROWS are arranged from left to right.

As you can see, spreadsheet(ROW) = Numpy(ARRAY)
and spreadsheet(COLUMN) = Numpy(ROW)

In Numpy, the content of each ROW represents the RGB value of that ROW.

In Numpy, ROW is the same as PIXEL.

In my previous post I stated that a PIXEL, is the smallest part of a picture just as an atom is the smallest part of an object. Pixels come together to form an image.

Finally, in Numpy, Arrays can be converted to images and images can be converted to Arrays.

CONCLUSION
Today, we talked about how Numpy array looks like diagrammatically as a group of pixels.

We also compared Numpy Array arrangement to the arrangement of cells in a spreadsheet software.

BY THE WAY........
We are building a complete Object Recognition System robotic companies.

This means that their teams do not need to do any computer vision related tasks as our system can do that for them.

If you would like to know more or if you know a company which might need our service,
please email us at email@rev25.com

or you can visit our website: https://rev25.com

Top comments (0)