Skip to content

Instantly share code, notes, and snippets.

View mpkuse's full-sized avatar

Manohar Kuse mpkuse

View GitHub Profile
@mpkuse
mpkuse / XYZ_2_latlong.py
Last active May 2, 2025 13:46
Convert GPS (Latitude and Longitude) to XYZ
""" Give a) points in localcoordinate system b) a gps lat long of the origin of the local coordinate system,
this script helps to convert XYZ to latlong.
Beware that the transformation will be off by an yaw angle. This is because the local cordinate frame is may/or may not align with the East-North-Up frame.
The way it works is XYZ --> ECEF --> geodedic (latlong)
main reference is still the wiki https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_ECEF_to_ENU.
However the procedure to convert from ECEF to geodedic in wikip does not give accurate results. Instead the algorithm
@mpkuse
mpkuse / CMakeLists.txt
Created September 6, 2016 09:10
CMake Project Template
cmake_minimum_required (VERSION 2.8)
project (proto_app)
add_executable( helloDemo hello.cpp )
target_link_libraries( helloDemo )
@mpkuse
mpkuse / CMakeLists.txt
Last active July 25, 2016 06:51
Setting up OpenGL with GLFW, GLEW
cmake_minimum_required (VERSION 2.8)
project (glfw_test)
find_package( glfw3 REQUIRED )
find_package( GLEW REQUIRED )
find_package( OpenGL REQUIRED )
set(CMAKE_CXX_FLAGS "-std=c++11")
add_executable( glDemo gl_test.cpp )
@mpkuse
mpkuse / binaryproto2numpy.py
Created July 11, 2016 03:29
.binaryproto of caffe to numpy array
# Converts the mean.binaryproto (mean image) to a numpy image.
import caffe
import numpy as np
import sys
blob = caffe.proto.caffe_pb2.BlobProto()
data = open('mean.binaryproto' , 'rb' ).read()
blob.ParseFromString(data)
arr = np.array( caffe.io.blobproto_to_array(blob) )