-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Nuhman Pk edited this page Jul 2, 2023
·
3 revisions
Welcome to the cv2filters wiki!
from cv2filters import Filters
import cv2
filters = Filters()
og_image = cv2.imread('./img.jpg')
image = filters.histogram_correction(og_image)
cv2.imwrite('histo.jpg', image)
image = filters.pencil(og_image)
cv2.imwrite('pencil.jpg', image)
image = filters.blur(og_image, kernal_size=(101, 101))
cv2.imwrite('blur.jpg', image)
image = filters.detect_edges(og_image)
cv2.imwrite('edge.jpg', image)
image = filters.crop_image(og_image, 10, 12, 100, 120)
cv2.imwrite('crop.jpg', image)
image = filters.bilateral_filter(og_image, d=12, sigma_color=150)
cv2.imwrite('bilateral.jpg', image)
image = filters.closing(og_image, iterations=3)
cv2.imwrite('closing.jpg', image)
image = filters.convert_to_grayscale(og_image)
cv2.imwrite('grayscale.jpg', image)
image = filters.dilation(og_image)
cv2.imwrite('dilation.jpg', image)
image = filters.erosion(og_image)
cv2.imwrite('erosion.jpg', image)
image = filters.flip_image(og_image, flip_code=1)
cv2.imwrite('flip.jpg', image)
image = filters.highlight_box(og_image, [100, 250, 300, 500])
cv2.imwrite('highlight.jpg', image)
image = filters.image_segmentation(og_image)
cv2.imwrite('segmentation.jpg', image)
image = filters.increase_brightness(og_image)
cv2.imwrite('brightness.jpg', image)
image = filters.morphological_opening(og_image)
cv2.imwrite('opening.jpg', image)
image = filters.resize_image(og_image, width=250, height=250)
cv2.imwrite('resize.jpg', image)
image = filters.rotate_image(og_image, angle=20)
cv2.imwrite('rotate.jpg', image)
image = filters.sobel_filter(og_image)
cv2.imwrite('sobel.jpg', image)