This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void visual(int* arr){ | |
| glClear(GL_COLOR_BUFFER_BIT); // sets the previous background with the current background | |
| drawBitmapString(400,570,sortName); | |
| drawBitmapString(400,550,"Number of Compares:"+std::to_string(compares)); | |
| drawBitmapString(400,530,"Number of Exchanges:"+std::to_string(exchanges)); | |
| glColor3f(1.0f,0.0f,0.0f); //red | |
| // drawing bars on the screen by diagonal coordinates | |
| for(int i=0;i<N;i++){ | |
| glRecti(4*i,0,4*i+3,arr[i]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void drawBitmapString(int x,int y,std::string s) | |
| { | |
| glColor3f(1.0f,1.0f,1.0f); // sets color of the text | |
| glRasterPos2f(x, y);// screen coordinate at which text will appear | |
| int length = s.size(); | |
| // writing charater by charater on the screen | |
| for(int i=0;i<length;i++) | |
| { | |
| glutBitmapCharacter( GLUT_BITMAP_HELVETICA_18, s[i]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # opencv(cv2) for image processing | |
| # numpy for efficient and easy matrix manipulations | |
| import cv2 | |
| import numpy as np | |
| from matplotlib import pyplot as plt | |
| # reading video from camera | |
| cap = cv2.VideoCapture(0) | |
| _, frame = cap.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import numpy as np | |
| cap = cv2.VideoCapture(0) | |
| ret,frame = cap.read() | |
| # HSV color space | |
| frame = cv2.cvtColor(frame,cv2.COLOR_BGR2HSV) | |
| cv2.imshow('image',frame) | |
| cv2.waitKey(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<bits/stdc++.h> | |
| using namespace std; | |
| class student | |
| { | |
| private: | |
| string name; | |
| int rollNumeber; | |
| public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<bits/stdc++.h> | |
| using namespace std; | |
| class student | |
| { | |
| private: | |
| string name; | |
| int rollNumeber; | |
| public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<bits/stdc++.h> | |
| using namespace std; | |
| class student | |
| { | |
| private: | |
| string name; | |
| int rollNumeber; | |
| public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<bits/stdc++.h> | |
| using namespace std; | |
| class student | |
| { | |
| private: | |
| string name; | |
| int rollNumeber; | |
| public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class student | |
| { | |
| private: | |
| string name; | |
| int rollNumeber; | |
| public: | |
| student(string sName,int roll); // Constructorn with two arguments | |
| }; | |
| student::student(string sName,int roll) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class student | |
| { | |
| private: | |
| string name; | |
| int rollNumeber; | |
| public: | |
| student(); // Constructor | |
| }; | |
| student::student() | |
| { |
NewerOlder