Skip to content

Instantly share code, notes, and snippets.

View iKrishneel's full-sized avatar
🏠
Working from home

Krishneel iKrishneel

🏠
Working from home
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
import json
from PIL import Image
def labelme_to_coco(labelme_json_folder, output_json_file):
# Create the basic structure for COCO
coco_output = {
"info": {},
"licenses": [],
"images": [],
# p = cv.aruco_CharucoDetector(cv.aruco_Board)
dictionary = cv.aruco.getPredefinedDictionary(cv.aruco.DICT_5X5_1000)
parameters = cv.aruco.CharucoParameters()
board = cv.aruco.CharucoBoard([7, 7], 0.03, 0.023, dictionary)
detector = cv.aruco.CharucoDetector(board, parameters)
im_gray = np.asarray(d.image)
corners, ids, marker_corners, marker_ids = detector.detectBoard(im_gray)
@iKrishneel
iKrishneel / homography.py
Created October 4, 2022 00:03
Finds the transformations between two images given the control points
#!/usr/bin/env python
import argparse
import numpy as np
import cv2 as cv
key = None
img = None
coordinates = {
'src': [],
#!/usr/bin/env python
import rospy
from phoxi_camera.srv import (
ConnectCamera,
ConnectCameraRequest,
GetFrame,
GetFrameRequest,
TriggerImage,
TriggerImageRequest,
@iKrishneel
iKrishneel / rt_kernel.sh
Last active August 25, 2022 01:18
realtime_kernal
#/usr/bin/env bash
VERSION=5.13
cd $HOME/ && mkdir rt_kernel && cd rt_kernel
wget -m -np https://cdn.kernel.org/pub/linux/kernel/projects/rt/$VERSION/
cd cdn.kernel.org/pub/linux/kernel/projects/rt/$VERSION/linux-$VERSION
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-$VERSION.tar.xz
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-$VERSION.tar.gz
version: "3"
services:
ros-azure-left:
image: sonyai/shokunin_azure:melodic
container_name: ros-azure-left
environment:
- "DISPLAY=${DISPLAY}"
- "QT_X11_NO_MITSHM=1"
- "LIBGL_ALWAYS_SOFTWARE=1"
<launch>
<node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager" />
<node pkg="nodelet" type="nodelet" name="nodelet1"
args="load depth_image_proc/point_cloud_xyzrgb nodelet_manager">
<param name="queue_size" value="10" />
<remap from="rgb/camera_info" to="/rgb/camera_info"/>
<remap from="rgb/image_rect_color" to="/rgb/image_raw"/>
<remap from="depth_registered/image_rect" to="/depth_to_rgb/image_raw" />
<remap from="depth_registered/points" to="/camera/depth/points"/>
#include <iostream>
#include <vector>
#include <string>
#include <bitset>
#include <algorithm>
#define BITS 4
using Matrix2D = std::vector<std::vector<int>>;
#include <iostream>
#include <vector>
#include <string>
#include <map>
struct Catelog {
std::string region_name;
int version;