Skip to content

Instantly share code, notes, and snippets.

import cv2
import numpy as np
import random
img = np.full((240, 240, 3), 255, dtype=np.uint8)
cv2.ellipse(img, ((random.randint(60, 180), random.randint(60, 180)),
(random.randint(10, 60), random.randint(10, 60)), random.randint(0, 90)), (0, 0, 0),
thickness=-1)
cv2.imwrite('opencv_draw_etc.png', img)
<launch>
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="first_tb3" default="tb3_0"/>
<arg name="second_tb3" default="tb3_1"/>
<arg name="third_tb3" default="tb3_2"/>
<arg name="first_tb3_x_pos" default="-2.0"/>
<arg name="first_tb3_y_pos" default=" 1.0"/>
<arg name="first_tb3_z_pos" default=" 0.0"/>
<arg name="first_tb3_yaw" default=" 0.0"/>
@takahub1
takahub1 / getImage.py
Last active October 13, 2017 09:34
python3 getImage.py "filename"
#-*- coding:utf-8 -*-
import os
import sys
import time
import bs4
import urllib.request
def crawring(url):
# 指定したURLのHTMLを取得
@takahub1
takahub1 / getURLlist.py
Last active October 13, 2017 09:34
python3 "url" "filename"
#-*- coding:utf-8 -*-
import os
import sys
import bs4
import urllib.request
def crawring(url, filename):
# 指定したURLのHTMLを取得
html = get_html_string(url)
#!/bin/sh
#mkdir -p ~/.vim/colors
#echo "setup molokai colorscheme"
#git clone https://github.com/tomasr/molokai ~/.vim/tmp
#mv ~/.vim/tmp/colors/molokai.vim ~/.vim/colors/
#rm -rf ~/.vim/tmp
echo "setup NeoBundle"
mkdir -p ~/.vim/bundle
@takahub1
takahub1 / index.html
Created May 23, 2017 15:22
htmlのチートシート
<html>
<head>
<title>タイトルを指定する</title>
</head>
<body>
ここに内容を書く</br>
<h1>見出し1</h1>
<h2>見出し2</h2>
@takahub1
takahub1 / CMakeLists.txt
Last active May 2, 2017 22:48
view pcd file
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(cloud_viewer)
find_package(PCL 1.2 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
@takahub1
takahub1 / pyqt5.py
Created April 28, 2017 16:19
sudo apt install python3-pyqt5
#!/usr/bin/env python
from PyQt5.QtWidgets import (QApplication, QWidget,
QGridLayout, QVBoxLayout, QHBoxLayout,
QLabel, QLineEdit, QPushButton)
def factorial(n):
if n < 0:
return -1
elif n == 0:
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <zbar.h>
#include <iostream>
using namespace cv;
using namespace std;
using namespace zbar;
//g++ main.cpp /usr/local/include/ /usr/local/lib/ -lopencv_highgui.2.4.8 -lopencv_core.2.4.8
#!/usr/bin/env python
from PyQt5.QtWidgets import (QApplication, QWidget,
QGridLayout, QVBoxLayout, QHBoxLayout,
QLabel, QLineEdit, QPushButton)
import socket
import datetime #for datetime
import os #for directory
import time #for sleep
import shutil #for fail copy