Using OpenCV for Python
Reading images using OpenCV functions : img_matrix = cv2.imread(src, conversion) -> src is the name of the image and conversion can be 0 for grayscale and 1 for coloured images. One can also use OpenCV constants as cv2.IMREAD_GRAYSCALE for grayscale and cv2.IMREAD_COLOR for coloured(without any alpha factor) and cv2.IMREAD_UNCHANGED for loading the alpha factor(transparency).
Writing images using OpenCV functions :cv2.imwrite(dst, src) -> dst is the name of the desired file name saving the image and src is the image matrix
Showing images: imshow(title, img_matrix) -> title can be set to any string and img_matrix is the image matrix
Forming Histogram : Counting the frequency of all the intensities starting from 0 to 255 and then plotting the frequency distribution using pylab. Example h is the array containing frequency distribution then
import pylab as plt
plt.title('Title')
plt.plot(h)
plt.show()
Histogram Equalization : A technique for image enhancement
Results of Histogram equalizations and comparisons with and without using OpenCV functions
Image Segmentation : Without using any OpenCV functions. Based on Global Thresholding
Results of Image Segmentation
<img src="result_segmentation2.png"
Results of Image Segmentation
<img src="result_segmentation.png"