HIP contains basic image processing functionality, including load, imshow, saveas, and color conversion.
HIP also supports image resizing, rotation, cropping, edge detection, gradient magnitude, affine transforms and adding different types of noise. These basic operations are used broadly in many image processing and computer vision pre-processing applications.
-
load() that loads an image using path to image or image values
load(self, image=None, path=None)
-
reset() that resets current instance with the original image which was used to construct HIP
reset(self)
-
imshow() that visualizes current image in HIP
imshow(self, tag="image")
-
height() that returns the height of the image
height(self)
-
width() that returns the width of the image
height(self)
-
channle() that returns the number of dimention of image (2D, 3D, etc)
channel(self)
-
save_as() that saves current image in HIP in a given path
save_as(self, path=None)
-
get_image() that returns current image
get_image(self)
-
rgb_to_gray() converts the RGB image to gray
rgb_to_gray(self)
-
binarize() that converts the image to a binary image given a threshold
binarize(self, threshold=128):
-
resize() that resizes the image given a resize ratio or another size(h,w)
resize(self, new_size=None, ratio=(0.5, 0.5), interpolation=cv2.INTER_AREA, use_ratio=False)
-
crop() that crops a region of the image given a crop window size
crop(self, crop_size)
-
flip() that flips the image horizantaly, vertically or both
flip(self, mode=0)
-
rotate() performs 2D rotation respect to a center and/or a rotation angle
rotate(self, degree=0, rotate_center=None)
-
zero_padd that adds zeros to the border of the image, given the padd size(left, right, top, bottom)
zero_padd(self, padd_size=[10, 10, 30, 30])
-
add_noise() for adding salt and pepper and gauss noise to the image
add_noise(self, noise="salt&pepper")
-
gradient() that returns dx and dy as gradient in x and y directions
gradient(self)
-
magnitude() that computes the magnitude of a the image
magnitude(self)
-
edge() computes the Sobel edge of the image
magnitude(self)
-
get_path() that returns the path of the image
get_path(self)