Short cmd | Full cmd | Description |
---|---|---|
a | args | Print all arguments with its value in current function |
b | break | Add breapoint at specific line or function |
c | continue | Continue execution of program until next breakpoint |
cl | clear | Clear all the soft breakpoints |
l | list | Print next 11 line of code aroung the current line |
l . | list . | Go back to the current debug point |
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
#!/bin/bash | |
#title :images2pdf.sh | |
#description :Best image compression ever. | |
#author :Pritesh Gohil | |
#date :08 Jan 2021 | |
#version :0.1 | |
#usage :bash images2pdf.sh -i ../Desktop/img_dir/ | |
#notes :Install ImageMagick and ghostscript packages. | |
#bash_version :5.0.16(1)-release |
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 <opencv2/opencv.hpp> | |
#include <iostream> | |
int main(int, char**) { | |
// open the first webcam plugged in the computer | |
cv::VideoCapture camera(0); // in linux check $ ls /dev/video0 | |
if (!camera.isOpened()) { | |
std::cerr << "ERROR: Could not open camera" << std::endl; | |
return 1; | |
} |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright 2016 Massachusetts Institute of Technology | |
# Tutorial : http://wiki.ros.org/rosbag/Code%20API#Python_API | |
""" | |
Extract images from a rosbag. | |
How to use: In terminal, cd DIRECTORY_OF_THIS_FILE and then type following | |
python bag_to_images.py --bag_file camera_odom_compressed.bag --output_dir output/ --image_topic '/camera/image_raw' | |
python bag_to_images.py --bag_file my_rosbag_file.bag --output_dir output/ --image_topic '/eGolf/front_cam/image_raw' |
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
#!/usr/bin/env python | |
""" | |
Author: Pritesh Gohil | |
Import or run this script to extract frames from a single video or | |
video directory using OpenCV | |
Requirement: numpy, cv2, tqdm | |
How to use: | |
Single Video |
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 random | |
import numpy as np | |
''' | |
Draw AABB in given image with labels | |
Inputs: img - image file path or cv2 image | |
: boxes_list - 2d list or 2d array of BBox (4 columns) with bounding boxes with top-left (x_min, y_min) and bottom right (x_max, y_max) pixel value. PS: maintain order xyxy | |
: label list - list(str) or 1-d array having name of the labels. Use cls = [classes[l] for l in list(labels)] # index to str labels | |
Return: CV2 image in BGR format |
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 time | |
import statistics | |
import numpy as np | |
def mean_normal(list_data): | |
""" | |
Calculate mean of python list normaly | |
input: list of int or float | |
output: mean value | |
""" |