First check your own gcc version, the default is 7.3 on Ubuntu18.04
$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
- Download gcc/g++ 5
| map: | |
| environment: name | |
| url: api_url | |
| status: api_ping | |
| docs: docs_url | |
| status-check: | |
| api_ping: status | |
| target: |
| # Date: 20 Sept 2021 | |
| # Script for installing opencv for c++ and python (without contrib modules) | |
| # Tested on Pop!_OS 20.04 | |
| echo "Installing Pre-requisites" | |
| sudo apt install build-essential cmake git pkg-config libgtk-3-dev \ | |
| libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ | |
| libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \ | |
| gfortran openexr libatlas-base-dev python3-dev python3-numpy \ | |
| libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \ |
| # Date: 20 Sept 2021 | |
| # Script for installing opencv for c++ and python with contrib modules | |
| # Tested on Pop!_OS 20.04 | |
| echo "Installing Pre-requisites" | |
| sudo apt install build-essential cmake git pkg-config libgtk-3-dev \ | |
| libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ | |
| libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \ | |
| gfortran openexr libatlas-base-dev python3-dev python3-numpy \ | |
| libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \ |
| import pandas as pd | |
| import os | |
| import cv2 as cv | |
| import gc | |
| from tqdm import tqdm | |
| import shutil | |
| from PIL import Image | |
| import xml.etree.ElementTree as ET | |
| ''' | |
| Image scrapping script | |
| Install libraries | |
| $pip install requests bs4 | |
| ''' | |
| # import required modules | |
| import requests # for get requests | |
| from bs4 import BeautifulSoup as bs # for scraping |
| import cv2 | |
| import numpy as np | |
| from matplotlib import pyplot as plt | |
| def get_bbox(path, plot=False): | |
| img = cv2.imread(path) | |
| orig = img.copy() | |
| ################ | |
| # denoise |
| ''' convert file format using ffmpeg in ubuntu | |
| windows install: https://video.stackexchange.com/questions/20495/how-do-i-set-up-and-use-ffmpeg-in-windows | |
| or https://www.wikihow.com/Install-FFmpeg-on-Windows | |
| Usage: | |
| $ python ./format_convert.py --input <dir/path> --output <dir/path> | |
| ''' | |
| import os | |
| import argparse |
| # Center Crop and Image Scaling functions in OpenCV | |
| # Date: 11/10/2020 | |
| # Written by Nandan M | |
| import cv2 | |
| def center_crop(img, dim): | |
| """Returns center cropped image | |
| Args: |
| ''' | |
| Date: 07/09/2020 | |
| Written by Nandan M | |
| ''' | |
| import cv2 | |
| import time | |
| # 0 is default webcam. Change to switch between multiple cameras or IP address. | |
| vc = cv2.VideoCapture(0) |