Task 4

Daya Yadav
2 min readJun 9, 2021

Task Description

Task 4.1
- Create image by yourself Using Python Code

Task 4.2
- Take 2 image crop some part of both image and swap it.

Task 4.3
- Take 2 image and combine it to form single image. For example collage

Task 4.1

here we have created an Indian flag using cv2 and numpy modules.

Task 4.2

Steps

Step 1:- Take Two Images
Step 2:-1D image will give an error, so image should be 2D or 3D.
Step 3:- Crop the images
Step 4:- swap the two images

Task 4.3

Steps

Firstly read both the images using imread() function
To concatenate images vertically and horizontally in Python, cv2 library has two functions as:

  1. hconcat(): It is used as cv2.hconcat() to concatenate images horizontally. Here h means horizontal.
  2. vconcat(): It is used as cv2.vconcat() to concatenate images vertically. Here v means vertical.
    here we have used only hconcat function.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Daya Yadav
Daya Yadav

Written by Daya Yadav

0 Followers

Student at DAIICT

No responses yet

Write a response