- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Shahid Akhtar Khan has Published 216 Articles
Shahid Akhtar Khan
881 Views
The solidity of an object is computed as the ratio of contour area to its convex hull area. So to compute the solidity, we first have to find the contour area and convex hull area. The contour area of an object can be found using cv2.contourArea() function. Equivalent Diameter is ... Read More
Shahid Akhtar Khan
914 Views
The extent of an object is computed as the ratio of contour area to its bounding rectangle area. So, to compute the extent, we first have to find the contour area and bounding rectangle area. The contour area of an object can be found using cv2.contourArea() function. Syntax The extent ... Read More
Shahid Akhtar Khan
3K+ Views
The aspect ratio of an object is computed as the ratio between the width and height of the bounding rectangle of the object. So, to compute the aspect ratio, we first have to find the bounding rectangle of the object. Bounding rectangle of an object can be found using cv2.boundingRect() ... Read More
Shahid Akhtar Khan
1K+ Views
A bilateral filter operation is highly effective in smoothing the image and removing noises. The main advantage of the bilateral filtering is that it preserves the edges unlike in average and median filtering. Bilateral filtering operation is slower in comparison to other filters. We can perform bilateral filtering on an ... Read More
Shahid Akhtar Khan
7K+ Views
We can fit an ellipse to an object using the function cv2.fitEllipse(). The ellipse is inscribed in a rotated rectangle. The rotated rectangle is a bounding rectangle with minimum area enclosing the object. Syntax The syntax used for this function is − ellipse = cv2.fitEllipse(cnt) Where, "cnt" is the ... Read More
Shahid Akhtar Khan
1K+ Views
In OpenCV, a color (RGB) image is represented as a 3-dimensional numpy array. The pixel values of an image are stored using 8 bit unsigned integers (uint8) in range from 0 to 255. The bitwise OR operation on two images is performed on the binary representation of these pixel values ... Read More
Shahid Akhtar Khan
1K+ Views
To add a watermark to an image, we will use the cv2.addWeighted() function from OpenCV. You can use the following steps to create a watermark on an input image − Import the required library. In all the following Python examples, the required Python library is OpenCV. Make sure you have ... Read More
Shahid Akhtar Khan
3K+ Views
A minimum enclosing circle (circumcircle) of an object is a circle which completely covers the object with minimum area. We can find the minimum enclosing circle of an object using the function cv2.minEnclosingCircle(). Syntax The syntax of this function is − (x, y), radius = cv2.minEnclosingCircle(cnt) Where, "cnt" are ... Read More
Shahid Akhtar Khan
3K+ Views
A Convex Hull looks similar to contour approximation, but it is not exactly a contour approximation. A convex hull is a convex curve around an object. A convex curve is always bulged out, or at-least flat. A convex hull finds the convexity defects and corrects them. Syntax To find the ... Read More
Shahid Akhtar Khan
2K+ Views
The Hu-Moments can be found using the cv2.HuMoments() function. It returns seven moments invariant to translation, rotation and scale. Seventh moment is skew-invariant. To compute the Hu-Moments, we need to first find the image. The image moments are computed for an object using the contour of the object. So, first, ... Read More