Real Time Shape Detection
Real Time Shape Detection
Real Time Shape Detection
Using OpenCV
And
Python
Real time shape detection
A PROJECT REPORT
SUBMITTED IN COMPLETE FULFILLMENT OF THE
REQUIREMENTS
FOR THE AWARD OF THE DEGREE OF
BACHELOR OF TECHNOLOGY IN
● Certificate
● Abstract
● Acknowledgement
● Introduction
● Background
● Approach
● Results
cv2.namedWindow("Frame")
cv2.createTrackbar("L-H", "Frame", 0, 180, nothing) #to create a
trackbar with edge values
cv2.createTrackbar("L-S", "Frame", 0, 225, nothing)
cv2.createTrackbar("L-V", "Frame", 0, 225, nothing)
cv2.createTrackbar("U-H", "Frame", 180, 180, nothing)
cv2.createTrackbar("U-S", "Frame", 255, 255, nothing)
cv2.createTrackbar("U-V", "Frame", 255, 255, nothing)
elif len(approx) == 4:
x, y, w, h = cv2.boundingRect(approx)
aspectRatio = float(w)/h
print (aspectRatio)
if aspectRatio >=0.95 and aspectRatio <= 1.05:
cv2.putText(frame, "Square ", (x, y),
cv2.FONT_HERSHEY_COMPLEX, 1, (0, 0, 0))
else:
cv2.putText(frame, "Rectangle ", (x, y),
cv2.FONT_HERSHEY_COMPLEX, 1, (0, 0, 0))
elif len(approx) == 5:
cv2.putText(frame, "pentagon ", (x, y),
cv2.FONT_HERSHEY_COMPLEX, 1, (0, 0, 0))
elif len(approx) == 6:
cv2.putText(frame, "Hexagon ", (x, y),
cv2.FONT_HERSHEY_COMPLEX, 1, (0, 0, 0))
elif len(approx) == 7:
cv2.putText(frame, "Septagon ", (x, y),
cv2.cv2.FONT_HERSHEY_COMPLEX, 1, (0, 0, 0))
elif len(approx) == 8:
cv2.putText(frame, "Octagon ", (x, y),
cv2.FONT_HERSHEY_COMPLEX, 1, (0, 0, 0))
else:
cv2.putText(frame, "circle ", (x, y), cv2.FONT_HERSHEY_COMPLEX,
1, (0, 0, 0))
key = cv2.waitKey(1)
if key == 27:
break
Results
Applications and future-work
● Person Detection
It has a conspicuous augmentation to automotive applications
because of the potential for improving security frameworks.
Person detection is undertaking Computer vision frameworks
for finding and following individuals. Person detection is the
task of finding all examples of individuals present in a picture,
and it has been most broadly achieved via looking through all
areas in the picture, at all potential scales, and contrasting a
little region at every area with known layouts or examples of
individuals.
● Vehicle Detection
By using Vehicle Detection technique we can detect the
number plate of a speeding car or accident affected car.
This also enables for security of the society and
decreasing the number of crimes done by car. By using
Vehicle Detection Technology Pixel Solutionz have
successfully detected the speed of the vehicle and we
have also detected the number plate of the car using
Optical Character Recognition (OCR)
MEDICAL IMAGING
Medical image processing tools are playing an increasingly
important role in assisting the clinicians in diagnosis, therapy
planning and image-guided interventions. Accurate, robust and
fast tracking of deformable anatomical objects such as the heart, is
a crucial task in medical image analysis.
Summary
The subtract is that the code displays the shape of the image
we kept in front of the camera if we adjust the
hue-saturation-value of the desired part by drawing and
counting the number of edges using the feature of drawing
contours in OpenCV. This code detects the images of the same
colours and shades considering absence of any sort of
distortion and the image is not crumbled or light absorbent.
This code be very useful and would serve as a kickstart to big projects
including web-development, machine learning etc.
Conclusion
The program as stated could be very useful and serve
different purposes. Further developments using this
code is already being done and changing our lives.