Site icon Towards AI

Image Intensity Manipulation

Image Intensity Manipulation

Last Updated on March 27, 2021 by Editorial Team

Author(s): Akula Hemanth Kumar

Computer Vision

Photo by Jonathan Bowers on Unsplash

What counts as intensity manipulation

Load Image using OpenCV

import numpy as np
import cv2
from matplotlib import pyplot as plt
img = cv2.imread(folder_path + "imgs/chapter3/man.jpg", 0);
plt.imshow(img, cmap = "gray");
plt.show()

Adding a constant value to input image using Opencv

img = cv2.imread(folder_path + "imgs/chapter3/man.jpg", 0);
##########################FOCUS############################
img = cv2.add(img, 120);
###########################################################
plt.imshow(img, cmap = "gray");
plt.show()

Subtracting a constant value to input image using Opencv

img = cv2.imread(folder_path + "imgs/chapter3/man.jpg", 0);
##########################FOCUS############################
img = cv2.subtract(img, 120);
####################################################################
plt.imshow(img, cmap = "gray");
plt.show()

Mean Subtraction from Image

Method 1

Method 2 (Used in Deep Learning)

For each channel of all images.

Applications

Negative images

Negative of Gray Scale

Negative of RGB images

Adding two images

Direct adding

Weighted Adding

Subtracting two images

Brightness

Contrast

Manipulating contrast in an image

Gamma

Manipulating gamma using Opencv

Histogram equalization

Histogram

Histogram equalization

Histogram visualization using Numpy

Histogram Equalization using OpenCV

You can find the complete jupyter notebook here.

If you have any questions, you can reach Abhishek . Feel free to reach out to him.

I am extremely passionate about computer vision and deep learning. I am an open-source contributor to Monk Libraries.

You can also see my other writings at:

Akula Hemanth Kumar – Medium


Image Intensity Manipulation was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.

Published via Towards AI

Exit mobile version