Found 10476 Articles for Python

OpenCV Python – How to perform SQRBox filter operation on an image?

Shahid Akhtar Khan
Updated on 02-Dec-2022 07:04:51

475 Views

We can perform SQRBox Filter operation on an image using cv2.sqrBoxFilter(). It calculates the normalized sum of squares of the pixel values overlapping the filter. We use the following syntax for this method − cv2.sqrBoxFilter(img, ddepth, ksize, borderType) where, img is the input image, ddepth is the output image depth, ksize is kernel size and borderType is border mode used to extrapolate pixels outside of the image. Steps To perform SQRBox filter operation, you could follow the steps given below- Import the required library. In all the following examples, the required Python library is OpenCV. Make sure ... Read More

OpenCV Python – How to add borders to an image?

Shahid Akhtar Khan
Updated on 02-Dec-2022 07:02:40

2K+ Views

OpenCV provides the function cv2.copyMakeBorder() to add borders in images. To add border in an image, you could follow the steps given below − The first step is to import required libraries. In all below Python examples the required Python library is OpenCV. Make sure you have already installed it. The next step is to read an input image using the cv2.imread() function. Specify the full image path with image types (.jpg or .png). Specify different parameters to the function cv2.copyMakeBorder(). The different parameters to be specified are src, dst, top, bottom, left, right, borderType, and value. Call ... Read More

OpenCV Python – How to find and draw extreme points of an object on an image?

Shahid Akhtar Khan
Updated on 02-Dec-2022 06:59:32

2K+ Views

To find and draw the extreme points of an object in the input image, we could follow the steps given below − The first step is to import required libraries. In all below Python examples the required Python library is OpenCV. Make sure you have already installed it. The next step is to read an input image using the cv2.imread() function. Specify the full image path with image types (.jpg or .png). Convert the input image to grayscale. Apply thresholding on the grayscale image to create a binary image. Adjust the second parameter to get a better contour ... Read More

OpenCV Python – How to draw circles using Mouse Events?

Shahid Akhtar Khan
Updated on 02-Dec-2022 06:55:16

2K+ Views

There are different types of muse events such as left or right button click, mouse move, left button double click etc. OpenCV provides us with different types of mouse events such as cv2.EVENT_LBUTTONDOWN for mouse left button down, cv2.EVENT_RBUTTONDOWN for right button down, cv2.EVENT_LBUTTONDBLCLK for left button double click and others. A mouse event returns the coordinates (x, y) of the mouse event. To perform an action when an event happens, we define a mouse callback function. We use mouse events to draw circles on the image. Steps To draw circles using mouse events, follow the steps given below ... Read More

Regression Analysis and the Best Fitting Line using Python

Mithilesh Pradhan
Updated on 01-Dec-2022 07:02:27

1K+ Views

In this tutorial, we are going to implement regression analysis and the best-fitting line using Python programming Introduction Regression Analysis is the most basic form of predictive analysis. In Statistics, linear regression is the approach of modeling the relationship between a scalar value and one or more explanatory variables. In Machine learning, Linear Regression is a supervised algorithm. Such an algorithm predicts a target value based on independent variables. More About Linear Regression and Regression Analysis In Linear Regression / Analysis the target is a real or continuous value like salary, BMI, etc. It is generally used to predict the ... Read More

How to split a Dataset into Train sets and Test sets in Python?

Mithilesh Pradhan
Updated on 01-Dec-2022 06:52:51

2K+ Views

In this tutorial, we are going to learn about how to split a Dataset into a Train set and a Test set using Python Programming Introduction While creating Machine Learning and Deep Learning Models we may come across scenarios where we may want to do both training and well as evaluation on the same dataset. In such cases, we may want to divide our dataset into different groups or sets and use each set for one task or specific process (e.g. training). In such situations, we may make use of training/test sets. Need for Train and Test sets It is ... Read More

How to Create simulated data for classification in Python

Mithilesh Pradhan
Updated on 01-Dec-2022 06:47:29

379 Views

In this Tutorial we will learn how to create simulated data from classification in Python. Introduction Simulated data can be defined as any data not representing the real phenomenon but which is generated synthetically using parameters and constraints. When and why do we need simulated data? Sometimes while prototyping a particular algorithm in Machine Learning or Deep Learning we generally face a scarcity of good real-world data which can be useful to us. Sometimes there is no such data available for a given task. In such scenarios, we may need synthetically generated data. This data can also be from Lab ... Read More

Python ñ Facial and hand recognition using MediaPipe Holistic

Jay Singh
Updated on 01-Dec-2022 05:35:43

783 Views

MediaPipe is a cross-platform open-source Machine Learning framework for creating complicated and multimodal applied machine learning pipelines. It can be used to create cutting-edge Machine Learning Models such as face identification, multi-hand tracking, object detection and tracking, and many more applications. MediaPipe simply functions as a middleman for managing model implementation for systems operating on any platform, allowing the developer to focus on experimenting with models rather than the system. This article will go over how to estimate full-body poses using MediaPipe holistic. The model will recognize all of our body's facial landmarks, hands, and positions. Installing and importing libraries ... Read More

Olympics Data Analysis Using Python

Jay Singh
Updated on 01-Dec-2022 05:31:04

2K+ Views

The contemporary Olympic Games, sometimes known as the Olympics, are major international sporting events that feature summer and winter sports contests in which thousands of participants from all over the world compete in a range of disciplines. With over 200 nations competing, the Olympic Games are regarded as the world's premier sporting event. In this article, we will examine the Olympics using Python. Let’s begin. Importing necessary libraries !pip install pandas !pip install numpy import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot as plt Importing and understanding the dataset We have ... Read More

How to Find the Z Critical Value in Python?

Jay Singh
Updated on 01-Dec-2022 05:27:54

903 Views

In this article, we are going to learn about how to find the Z Critical Value in Python. What is Z Critical Value? In statistics, the region under the common normal model is referred to as the Z critical value. Every possible variable's probability is shown. A test statistic is what is produced when we do a hypothesis test. To determine if the outcome of the hypothesis test is statistically significant, the test statistic can be compared to a Z critical value. An outcome is regarded as statistically significant when its absolute value exceeds the Z critical value. The determination ... Read More

Advertisements