Skip to content

Instantly share code, notes, and snippets.

@frakw
frakw / labelme_gen_mask_img.py
Created December 4, 2023 18:54
Convert all labelme generated json into mask image in every subdirectory
# Author : frakw
# Date : 2023-12-04
# Description : Convert all labelme generated json into mask image in every subdirectory
# Usage : python labelme_gen_mask_img.py
import json
import numpy as np
import cv2
import os
import fnmatch
@frakw
frakw / april_6x6_80x80cm.yaml
Created August 15, 2023 08:03
Camer IMU Calibratoion Resources
target_type: 'aprilgrid' #gridtype
tagCols: 6 #number of apriltags
tagRows: 6 #number of apriltags
tagSize: 0.03 #size of apriltag, edge to edge [m]
tagSpacing: 0.3 #ratio of space between tags to tagSize
codeOffset: 0 #code offset for the first tag in the aprilboard
@frakw
frakw / imgui_glad_glfw.cpp
Last active May 8, 2023 16:28
example code for test imgui using glad and glfw
#include "imgui/imgui.h"
#include "imgui/imgui_impl_glfw.h"
#include "imgui/imgui_impl_opengl3.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <string>
int main(void)
{
@frakw
frakw / HW1_B10815057.cpp
Created November 6, 2021 17:35
彩色影像處理作業1 B10815057 廖聖郝
#include <iostream>
#include <string>
#include <random>
#include <fstream>
#include <algorithm>
#include <time.h>
#include <chrono>
#include <limits>
#include <opencv2/opencv.hpp>
#define CVPLOT_HEADER_ONLY
@frakw
frakw / HgtReader.cs
Last active November 2, 2021 18:27
unity 讀取 hgt檔 hgt file reader
using System.Collections;
using System.Collections.Generic;
using System;
using System.IO;
using System.Text;
using UnityEngine;
[System.Serializable]
public class EarthCoord
{
#include <string>
#include <set>
#include <iostream>
#include <iterator>
using namespace std;
#define MAX_ARRAY_SIZE 299983//list陣列大小,用質數可以減少碰撞
//參考自:https://stackoverflow.com/questions/7666509/hash-function-for-string
unsigned int djb2(string& word) {//hash function
@frakw
frakw / word_checker.cpp
Created December 29, 2020 16:03
HOMEWORK 5-1
#include <fstream>
#include <string>
#include <set>
#include <iostream>
#include <numeric>
#include <unordered_map>
#include <iterator>
#include <chrono>
#include <sstream>
using namespace std;
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <iomanip>
using namespace std;
template<typename N,typename P>
//N 為名稱資料型別 P為probability資料型別
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
template<typename element,typename order>//element是heap內的資料型別(int),order是優先權的資料型別(char)
class heap_node {//heap node的class
public:
heap_node() {}
heap_node(element i, order p, heap_node<element, order>* f) : data(i), priority(p),father(f) {}
template<typename, typename> friend class heap;
@frakw
frakw / input.dot
Last active December 9, 2020 11:51
digraph STG {
rankdir=LR;
INIT [shape=point];
a [label="a"];
b [label="b"];
c [label="c"];
d [label="d"];
e [label="e"];
f [label="f"];