OpenCV Tutorials

opencv cell classification 0

OpenCV Project – Cell Classification

Cell classification is a crucial task in biomedical image analysis involving the categorization of cells into distinct groups based on visual characteristics. Leveraging advanced technologies such as convolutional neural networks (CNNs) and cell classification...

blob detection using opencv 0

Blob Detection using OpenCV

Ever wondered how computers uncover hidden treasures within images? Welcome to the realm of ‘Blob Detection,’ where even the most inconspicuous regions become keys to unlocking visual mysteries. In this captivating journey, we’ll explore...

How to Use Different Color Codes in OpenCV 0

How to Use Different Color Codes in OpenCV

Program 1 import cv2 import matplotlib.pyplot as plt img=cv2.imread(“D://opencvapp//wildlifeImages//wildlife-tiger.jpg”) cv2.imshow(‘Origal Image ‘,img) #BGR to RGB rgb=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) cv2.imshow(‘RGB in OpenCV Image ‘,rgb) plt.imshow(rgb) plt.show() # #BGR to Gray # gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) # cv2.imshow(‘Gray Image ‘,gray) #...

Canny Edge Detection in OpenCV 0

Canny Edge Detection in OpenCV

Program 1 import cv2 img=cv2.imread(“D://opencvapp//wildlifeImages//wildlife-tiger.jpg”) cv2.imshow(‘Original Image’,img) #blur=cv2.blur(img,(9,9)) blur=cv2.GaussianBlur(img,(17,17),10) cv2.imshow(‘Blur Image’,blur) canny=cv2.Canny(img,125,125) print(type(canny)) cv2.imshow(‘Canny Image’,canny) cv2.waitKey(0) cv2.destroyAllWindows()  

Image Transformations Using OpenCV 0

Image Transformations Using OpenCV

Program 1 import cv2 import numpy as np img=cv2.imread(“D://opencvapp//wildlifeImages//walking-dog.jpg”) print(type(img)) cv2.imshow(‘Orginal Image Window’,img) x=-100 y=100 trans=np.float32([[1,0,x],[0,1,y]]) dim=((img.shape[1],img.shape[0])) img1=cv2.warpAffine(img,trans,dim) cv2.imshow(‘Transformation Image Window’,img1) cv2.waitKey(0) cv2.destroyAllWindows()  

How to Draw Different Shapes in OpenCV 0

How to Draw Different Shapes in OpenCV

Program 1 import cv2 import numpy as np emptyimg=np.zeros((700,700,3)) #emptyimg[200:300,300:400]=255,0,0 # Draw Rectangle #cv2.rectangle(emptyimg,(50,50),(300,300),(0,0,255),thickness=cv2.FILLED) # print(emptyimg.shape[1]//2) # print(emptyimg.shape[0]//2) #cv2.rectangle(emptyimg,(30,30),(emptyimg.shape[1]//2,emptyimg.shape[0]//2),(255,255,0),thickness=cv2.FILLED) #Draw circle # cv2.circle(emptyimg,(100,100),70,(0,0,255),thickness=cv2.FILLED) # cv2.imshow(‘Blank Window’,emptyimg) #Draw circle # cv2.line(emptyimg,(0,0),(300,300),(0,255,0),thickness=3) # cv2.line(emptyimg,(500,0),(0,500),(0,255,0),thickness=7) cv2.rectangle(emptyimg,(50,50),(650,150),(0,255,255),thickness=1) cv2.putText(emptyimg,”Data...

How to Open Video using Dialog Box in OpenCV 0

How to Open Video using Dialog Box in OpenCV

Program 1 from tkinter import* import tkinter.messagebox as msg import tkinter.filedialog as fd import cv2 def clickmenu(choice): if(choice==’open’): filename = fd.askopenfilename(parent=myroot, title=’open file window’, filetypes=((“Video”, “*.mp4”), (“All File”, “*.*”))) vdo = cv2.VideoCapture(filename) while True:...