The document discusses using OpenCV for shape detection and classification. It describes OpenCV as a cross-platform library containing over 500 algorithms for image and video analysis. The methodology used includes identifying contours, classifying shapes based on number of vertices (triangles have 3, rectangles have 4), and categorizing objects to determine the appropriate disinfection technique. The object detection system involves capturing images of objects placed on a conveyor belt using a camera, identifying the shapes, and activating the conveyor and disinfection technique based on the classification.
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views
Object Detection
The document discusses using OpenCV for shape detection and classification. It describes OpenCV as a cross-platform library containing over 500 algorithms for image and video analysis. The methodology used includes identifying contours, classifying shapes based on number of vertices (triangles have 3, rectangles have 4), and categorizing objects to determine the appropriate disinfection technique. The object detection system involves capturing images of objects placed on a conveyor belt using a camera, identifying the shapes, and activating the conveyor and disinfection technique based on the classification.
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13
Shape detection and
classification using OpenCV
Tools • OpenCV • A multitude of software program equipment and libraries. Manipulating images and movies are available, however for Anyone who needs to advance smart vision-based Applications, the OpenCV library is the tool to use. • Below are listed the major motives why we have Chosen OpenCv: • A) Cross-Platform Library • OpenCV is a cross-platform library, enabling customers on different working structures to use it besides Complications. • B) Vast Algorithms • OpenCV (Open-source Computer Vision) is an open source library containing more than five hundred optimized Algorithms for photo and video analysis. • C) Extensive Use • OpenCV is being used by using massive organizations like Google, IBM, Toyota and startups such as Applied Minds and Zeitera as properly as agencies in countries all over the World to behavior multifarious tasks. This gives customers assurance that they are on board of a library that is Being used substantially through companies and authorities • D) Efficient • OpenCV was once designed for computational efficiency and with a sturdy focus on real-time applications. Written in Optimized C/C++, the library can take gain of Multi-core processing. Enabled with OpenCL, it can Take advantage of the hardware acceleration of the Underlying heterogeneous compute platform. Methodology used 1)Contours identification and utilized techniques Contours characterize the shapes of Objects located in an image. If internal element is seen in an image, the object may additionally produce numerous related Contours, which are again in a hierarchical facts Structure. Once the contours of an object are detected, we can do things like decide the range of objects in an image, classify the shapes of the objects, measure the measurement of the objects etc. The input to the contour finding system is a binary image, which it will Produced by means of first making use of thresholding and/ or aspect Detection techniques • A) Noise Reduction • Since area detection is susceptible to noise in the Image, first step is to eliminate the noise in the image with a 5x5 Gaussian filter. • B) Finding Intensity Gradient of The Image • Smoothened image is then filtered with a Sobel kernel in both horizontal and vertical direction to get first Derivative in horizontal route (gx) and vertical Direction (gy). • C) Non-maximum suppression • After getting gradient magnitude and direction, a full Scan of image is completed to dispose of any undesirable pixels Which can also no longer constitute the edge. • D) Hysteresis thresholding • This stage determines which edges are actual edges and Which are not. For these two threshold values are needed, minVal and maxVal. Any edges with intensity gradient more than maxVal are certain to be edges and these under minVal are certain to be non-edges. • E) Counter Detection Algorithm in OpenCV • Pixel-following approach traces contour pixels in a predefined manner and then saves their coordinates in reminiscence according to the trace order. • OpenCv has a constructed in technique that implements an Algorithm for contour detection: cv2.findContours(). This approach takes as input three parameters: first one is Source image, second is contour retrieval mode and third is contour approximation method. The outputs Are: image, contours and hierarchy. • Contour approximation is an algorithm for reducing the quantity of points in a curve with a decreased set of points — for that reason the time period approximation. • Contour approximation is carried out in OpenCV via the cv2.approxPolyDP method. • If the approximated contour has three vertices, then it ought to be a triangle • If a contour has 4 vertices, then it must be either a rectangular or a rectangle. • To determine which, we compute the thing ratio of the shape, which is simply the width of the contour bounding field divided through the height If the factor ratio is ~1.0, then we are inspecting a square (since all aspects have approximately equal length). Otherwise, the form is a rectangle • If a contour has five vertices, we can label it as a pentagon. • Otherwise, by using procedure of elimination we can make the assumption that the form we are analysing is a circle. • 2)Object Categorization • Objects will be divided in two classes A & B. If the identified object falls in class A then UV disinfection technique will be used. If the object falls in class B dry fogging technique will be used for disinfection. • Based on the size of the object time duration will be calculated Object detection and classification The most essential part is the Conveyor. His position is to shift geometric Shapes into the chamber. The conveyor is built by two rollers, one of which is passive and the other is Active. The energetic one is moved by means of servo motor and is Responsible for transferring the complete conveyor: 1)Object will be placed on the marked position on the conveyor belt. 2) Following which the camera captures the image. 3)Object image is sent for the identification. 4)Based on the shape of the object it will be identified. 5)Once the identification is done conveyor starts to move and the suitable object detection technique will be used. References • https://docs.opencv.org/master/da/d22/tutorial_py_canny.html • Shape detection and classification using OpenCV and Arduino Uno, by Xhensila Poda, Olti Qirici, Faculties of Natural Sciences, University of Tirana