![Pokémon volt white 2](https://cdn1.cdnme.se/5447227/9-3/6_64e61dfae087c31b411cc5f3.png)
![divide image into grid divide image into grid](https://i.stack.imgur.com/uKVpb.png)
The last function cv2.waitKey() takes only one argument that is time in ms. Example: cv2.imwrite('name_of_the_image.jpg',left_part) To save the resultant image on the computer we use the cv2.imwrite() function which also takes two arguments one is a string and the other is the image to be saved. Example: cv2.imshow('Title of the image', left_part) It goes something like this: left_part = imgĪfter storing the two parts in different variables, we are displaying them using the cv2.imshow() function which takes two arguments 1st, the title of the image which is a string, and 2nd is the image to be displayed. Hence dividing images into two or more parts means basically slicing a matrix into two or more parts.įor horizontal division, we need to divide the width by a factor of 2 and then take the matrix till that index and store it in a variable ‘left_part’ in this case. Why? As mentioned earlier images are nothing but a 2D matrix of colour pixel intensities. After that performing list slicing on the image will produce the desired result. Then extract the dimensions of the image by using img.shape command and store the value into h, w, channels respectively. ISRO CS Syllabus for Scientist/Engineer Examįirst, select an image as input and read it using the cv2.imread() function.
![divide image into grid divide image into grid](https://ecdn.teacherspayteachers.com/thumbitem/Long-Division-on-Graph-Paper-Bundle-4543802-1604053901/original-4543802-3.jpg)
![divide image into grid divide image into grid](https://i.pinimg.com/originals/b5/c7/36/b5c736d9649240e18c64fa2119357c64.png)
Android App Development with Kotlin(Live).Full Stack Development with React & Node JS(Live).Java Programming - Beginner to Advanced.Data Structure & Algorithm-Self Paced(C++/JAVA).Data Structures & Algorithms in JavaScript.Data Structure & Algorithm Classes (Live).
![Pokémon volt white 2](https://cdn1.cdnme.se/5447227/9-3/6_64e61dfae087c31b411cc5f3.png)