This file contains 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
# 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 |
This file contains 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
inline float SIGN(float x) { | |
return (x >= 0.0f) ? +1.0f : -1.0f; | |
} | |
inline float NORM(float a, float b, float c, float d) { | |
return sqrt(a * a + b * b + c * c + d * d); | |
} | |
// quaternion = [w, x, y, z]' | |
Mat mRot2Quat(const Mat& m) { |
This file contains 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
/* | |
AUTO-COMPLETE SNIPPETS FOR GLSL WITHIN VISUAL CODE STUDIO | |
Lewis Lepton | |
https://lewislepton.com | |
useful places that i grabbed info from | |
http://www.shaderific.com/glsl | |
https://www.khronos.org/opengl/wiki/OpenGL_Shading_Language | |
plus various other papers & books | |
*/ |
This file contains 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
/* | |
* A simple example of json string parsing with json-c. | |
* | |
* clang -Wall -g -I/usr/include/json-c/ -o json_parser json_parser.c -ljson-c | |
*/ | |
#include <json.h> | |
#include <stdio.h> | |
int main() { | |
struct json_object *jobj; |
This file contains 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
// Converts degrees to radians. | |
#define degreesToRadians(angleDegrees) (angleDegrees * M_PI / 180.0) | |
// Converts radians to degrees. | |
#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / M_PI) |