IMAGE PROCESSING WITH OPENCV USING PYTHON

IMAGE PROCESSING WITH OPENCV USING PYTHON

What is Image Processing?

Image processing aims to transform an image into digital form and performs some process on it, to get an enhanced image or take some utilized information from it. It is a method that develops to convert the image into digital form and perform some operations to obtain specific models or to extract useful information from it. The input of this method is a video section or an image, such as a photograph. The output corresponds to the desired or attention part of the picture. Generally, the Image Processing system treats images as two-dimensional signals when applying predetermined signal processing methods.

OPENCV AND IMAGE PROCESSING:

OpenCV is used as an image processing library in many computer vision real-time applications. There are thousands of functions available in OpenCV. These simple techniques are used to shape our images in our required format. As we know an image is a combination of pixels, for a color image we have three channels with pixels ranging from 0 to 225, and for black & white-colored images has only one change ranging from 0 to 1.

PYTHON LIBRARIES USED IN THIS TASK:-

1) NUMPY:- By reading the image as a NumPy array ndarray, various image processing can be performed using NumPy functions. By the operation of ndarray, you can get and set (change) pixel values, trim images, concatenate images, etc. Those who are familiar with NumPy can do various image processing without using libraries such as OpenCV.

Even when using OpenCV, OpenCV for Python treats image data as ndarray, so it is useful to know how to use NumPy (ndarray). In addition to OpenCV, there are many libraries such as scikit-image that treat images as ndarray.

2) OPENCV:- OpenCV is a Python open-source library, which is used for computer vision in Artificial intelligence, Machine Learning, Face Recognition, etc.

In OpenCV, the CV is an abbreviation form of a computer vision, which is defined as a field of study that helps computers to understand the content of the digital images such as photographs and videos.

The purpose of computer vision is to understand the content of the images. It extracts the description from the pictures, which may be an object, a text description, and three-dimension model, and so on. For example, cars can be facilitated with computer vision, which will be able to identify and different objects around the road, such as traffic lights, pedestrians, traffic signs, and so on, and acts accordingly.

Let's have the description of task, first:-

?? 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.

First, look at the installation process of OpenCV:

Use the command: pip install opencv-python==3.4.2.17 in Anaconda Prompt.

So after successful installation of OPENCV library, let's perform Task 4.1

Task 4.1 Create image by yourself Using Python Code :

Import numpy and opencv libraries, and write the code for creating image.

No alt text provided for this image
No alt text provided for this image

OUTPUT:-

No alt text provided for this image

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

Take 2 images, read them, then we'll crop and then swap them.

No alt text provided for this image

The two images:

No alt text provided for this image
No alt text provided for this image

These are the two images:







No alt text provided for this image


No alt text provided for this image


Now these are the cropped images.


No alt text provided for this image





Now let's swap the images:

No alt text provided for this image

Output:-

No alt text provided for this image


No alt text provided for this image

TASK 4.3 Take 2 image and combine it to form single image. For example, collage.

CODE:

No alt text provided for this image

OUTPUT:

No alt text provided for this image

Hence, our task has been completed successfully.

Thank you for reading this article till here!!!!

KEEP LEARNING AND KEEP SHARING!!!!!

要查看或添加评论,请登录

Vrushali Mahajan的更多文章

  • ??AMAZON SQS AND NASA??

    ??AMAZON SQS AND NASA??

    Amazon provides SDKs in several programming languages including Java, Ruby, Python, .NET, PHP, Go and JavaScript.

  • ??AWS CLI COMMANDS??

    ??AWS CLI COMMANDS??

    Task Description ?? Create a key pair. ?? Create a security group.

    1 条评论
  • ??K-mean clustering and its real usecase in the security domain??

    ??K-mean clustering and its real usecase in the security domain??

    Let's first understand, what exactly is K-mean clustering in machine learning? K-means clustering is one of the…

  • ??HELM CHARTS??

    ??HELM CHARTS??

    Before we start let us know what are Helm Charts and why do Kubernetes use them? Helm uses a packaging format called…

  • ??Multi-Node Cluster & Stateful Apps Like MySql and Wordpress??

    ??Multi-Node Cluster & Stateful Apps Like MySql and Wordpress??

    What is Kubernetes exactly? Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling,…

    2 条评论
  • ??USE CASES OF JAVASCRIPT??

    ??USE CASES OF JAVASCRIPT??

    Let's start with What exactly is Javascript? JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled…

  • IBM AND ITS USE CASES SOLVED BY KUBERNETES

    IBM AND ITS USE CASES SOLVED BY KUBERNETES

    Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of…

  • ??CYBER CRIMES AND CONFUSION MATRIX??

    ??CYBER CRIMES AND CONFUSION MATRIX??

    Let's start with knowing, what exactly is cyber crime? Cybercrime is criminal activity that either targets or uses a…

  • RUNNING GUI APPS IN A DOCKER CONTAINER

    RUNNING GUI APPS IN A DOCKER CONTAINER

    What is GUI? Graphical user interface (GUI), a computer program that enables a person to communicate with a computer…

  • Running Machine Learning model in Docker Container

    Running Machine Learning model in Docker Container

    Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers…

社区洞察

其他会员也浏览了