diff --git a/C++/Algorithms/sorting.cpp b/C++/Algorithms/sorting.cpp new file mode 100644 index 00000000..f0dbd560 --- /dev/null +++ b/C++/Algorithms/sorting.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; +void selectionSort(int a[], int n) { + int i, j, min, temp; + for (i = 0; i < n - 1; i++) { + min = i; + for (j = i + 1; j < n; j++) + if (a[j] < a[min]) + min = j; + temp = a[i]; + a[i] = a[min]; + a[min] = temp; + } +} +int main() { + int a[] = { 22, 91, 35, 78, 10, 8, 75, 99, 1, 67 }; + int n = sizeof(a)/ sizeof(a[0]); + int i; + cout<<"Given array is:"< 0.5: + # transform bounding box format + box = [(box[0], box[1]), (box[2], box[3])] + + # select class color + color = colors[box_class] + + # extract class name + class_name = classes[box_class] + + # draw the bounding box + cv2.rectangle(img=img, + pt1=box[0], + pt2=box[1], + color=color, + thickness=2) + + # display the box class label + cv2.putText(img=img, + text=class_name, + org=box[0], + fontFace=cv2.FONT_HERSHEY_SIMPLEX, + fontScale=1, + color=color, + thickness=2) + +cv2.imshow("Object detection", img) +cv2.waitKey()