-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopencv.cpp
More file actions
30 lines (24 loc) · 915 Bytes
/
Copy pathopencv.cpp
File metadata and controls
30 lines (24 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <opencv2/opencv.hpp>
#include <iostream>
#include <chrono>
#include "LunaCV.hpp"
int main() {
int width = 2000;
int height = 1500;
cv::Mat blankImage(height, width, CV_8UC3, cv::Scalar(0, 0, 0));
// int Size = 300;
std::vector<int> v = NewSortedVector(500);
int size = 50;
int* n = NewSortedArray(size);
ShuffleVector(v);
ShuffleArray(n,size);
auto start = std::chrono::high_resolution_clock::now();
RadixSort(v,blankImage,height,width-200,true);
// MergeSort(v, int 0,v.size()-1,blankImage,height,width);
// std::sort(std::begin(v),std::end(v));
// BubbleSort(n,size,blankImage,height,width-200);
auto end = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(end-start);
std::cout<<"Time : "<<double(duration.count()/double(1000000))<<" milliseconds\n";
return 0;
}