Ginni

Ginni

1,237 Articles Published

Articles by Ginni

Page 121 of 124

What are different levels of abstraction in Computer Architecture?

Ginni
Ginni
Updated on 20-Jul-2021 5K+ Views

There are three different layers of abstraction in computer system such as the concrete architecture at the system level, the abstract and concrete architecture at the processor level, and the abstract and concrete architecture at the micro-machine level. Let us discuss each level one by one.Concrete Architecture of Computer SystemsAt the system level, the representation of the concrete architecture depends on processor level building blocks, including processors, memories, buses, etc. Its representation contains the description of the building blocks, the interpretation among them, and the services of the entire system. The figure shows an example of the system-level architecture of ...

Read More

How Region of Interest (ROI) works in OpenCV using C++?

Ginni
Ginni
Updated on 03-May-2021 3K+ Views

To separate a particular portion from the image, we have to locate the area first. Then we have to copy that area from the main image to another matrix. This is how the ROI in OpenCV works.In this example, two matrices have been declared at the beginning. After that, an image named 'image_name.jpg' has been loaded into the 'image1' matrix. The next line 'image2=image1 (Rect(100, 100, 120, 120));' requires special attention. This line is cropping out the defined region of the image and storing it in the 'image2' matrix.The figure shows what we have done here with the 'Rect(100, 100, ...

Read More

How to detect and track the motion of eyeball in OpenCV using C++?

Ginni
Ginni
Updated on 10-Mar-2021 634 Views

Here, we will learn how to detect and track the motion of eyeball in OpenCV.The following program demonstrates to detect the eyeball and track the location.Example#include #include #include #include #include #include using namespace cv; using namespace std; Vec3f eyeBallDetection(Mat& eye, vector& circles) {    vectorsums(circles.size(), 0);    for (int y = 0; y < eye.rows; y++) {       uchar* data = eye.ptr(y);       for (int x = 0; x < eye.cols; x++) {          int pixel_value = static_cast(*data);          for (int i = 0; i < circles.size(); i++) {   ...

Read More

How to track the face in real-time in OpenCV using C++?

Ginni
Ginni
Updated on 10-Mar-2021 434 Views

We will learn how to track the face in real-time in OpenCV. This program is same to the previous program and difference is that we used ellipse instead of rectangle to identify the face and we also used additional 'cout' statement to show the co-ordinate of the face in the console window.The following program to detect human face in real-time −Example#include #include #include //This header includes definition of 'rectangle()' function// #include //This header includes the definition of Cascade Classifier// #include using namespace std; using namespace cv; int main(int argc, char** argv) {    Mat video_stream;//Declaring a matrix hold frames from ...

Read More

How to detect the largest face in OpenCV using C++?

Ginni
Ginni
Updated on 10-Mar-2021 371 Views

We will learn how to detect the largest face only. This topic is same as the previous topic. The only difference is we used an additional 'Rect' structure and a 'for loop' to detect the largest face.The actual format of this function −Mat faceROI = image_with_humanface(maxRect)The maxRect have the area and location information of the largest face located on the image. The line above is cropping the same area stored in maxRect on the same location where the largest face is located on the image and storing in 'faceROI' matrix.The following program detects the largest face from still pictures −Example#include ...

Read More

How to crop the detected faces in OpenCV using C++?

Ginni
Ginni
Updated on 10-Mar-2021 856 Views

We will know how to crop the detected faces in OpenCV. To crop detected faces, we need multiple matrices. The most appropriate way is to use an image array. In this program using the following two lines, we have declared two image matrices −Mat cropped_faces[4];Mat faceROI[4];The first matrix is to store the cropped images, and the second matrix is to define the region of interest. In the detection process, first, the program locates the faces and store them in vectors. In our program, the name of the vector is 'faces' Vectors can contain multiple elements.Using the following two lines, we ...

Read More

How to count the number of faces in OpenCV using C++?

Ginni
Ginni
Updated on 10-Mar-2021 389 Views

Counting the number of faces located in an image is easy. The program we wrote in the previous section already have the information of number of faces in 'faces.size()'. This code-'faces.size()' gives an integer value.For example, if we write 'int x = faces.size()', the 'x' will contain the number of faces.The following program calculates the number of faces from a given image and shows it in console window.Example#include #include #include //This header includes the definition of Cascade Classifier// #include using namespace std; using namespace cv; int main(int argc, char** argv){    Mat image_with_humanface;//Declaring a matrix to load image with human ...

Read More

How to detect the face in still picture in OpenCV using C++?

Ginni
Ginni
Updated on 10-Mar-2021 804 Views

We detect the faces from the image. To detect the face, we used 'detectMultiScale()' function.The actual format of this function is −SyntaxdetectMultiScale(source matrix, vector, searchScaleFactor, minNeighbours, flags, minfeatureSize)By changing the function arguments, we can control the 'detect.MultiSpace()' function. This function takes the following arguments.Source MatrixIt is the matrix where the face will be detected. In this case, it will the matrix which is keeping the video frames.VectorThe 'detect.MultiScale()' function will be a vector of rectangular type. A rectangle is a vector in OpenCV, and we have to define it as a vector.searchScaleFactorSearch scale factor determines how many different sizes of ...

Read More

How to detect the color using OpenCV in C++?

Ginni
Ginni
Updated on 10-Mar-2021 2K+ Views

We will understand how to detect specific color and track object based on color. Performance of color detection and color detection based tracking system is environment dependent.If you change light of the room or if you change background color, there will be significant effect on color detection.The following program demonstrates how to detect the color using OpenCV in C++.Example#include #include #include using namespace std; using namespace cv; int main(int argc, char** argv) {    VideoCapture video_load(0);//capturing video from default camera//    namedWindow("Adjust");//declaring window to show the image//    int Hue_Lower_Value = 0;//initial hue value(lower)//    int Hue_Lower_Upper_Value = 22;//initial hue ...

Read More

How to rotate a video in OpenCV using C++?

Ginni
Ginni
Updated on 10-Mar-2021 661 Views

Rotating a video is similar to rotate an image. The only difference is instead of load a still picture into an image matrix, we have loaded a video or take video stream from the camera.Here, we are not loading the video but taking a video using the camera. If you want to use a video file, just put the address of the video file properly.The following program demonstrates how to rotate a video in OpenCV using C++.Example#include #include #include using namespace std; using namespace cv; int main(int argc, char* argv[]) {    VideoCapture loadvideo(0);//capture video from default camera//    namedWindow("OriginalVideo");//declaring ...

Read More
Showing 1201–1210 of 1,237 articles
Advertisements