This file contains hidden or 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
video_name = 'out.mp4' | |
frame = cv2.imread(images[0]) | |
height, width, layers = frame.shape | |
fourcc = cv2.VideoWriter_fourcc(*'H264’) # may try x264 | |
video = cv2.VideoWriter(video_name, fourcc, 6, (width,height)) | |
for image in images: | |
video.write(cv2.imread(image)) |
This file contains hidden or 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
def heat_map_rgb(minimum, maximum, value): | |
minimum, maximum = float(minimum), float(maximum) | |
ratio = 2 * (value-minimum) / (maximum - minimum) | |
b = int(max(0, 255*(1 - ratio))) | |
r = int(max(0, 255*(ratio - 1))) | |
g = 255 - b - r | |
return (r, g, b) |
This file contains hidden or 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
## https://gist.github.com/pierriko/fd49abfa2fb3561f9c89 | |
## https://github.com/omgteam/Didi-competition-solution | |
# attach process: https://www.jetbrains.com/help/pycharm/2016.3/attaching-to-local-process.html | |
import sys | |
##sys.path.insert(0,'/opt/ros/kinetic/lib/python2.7/dist-packages') | |
##sys.path.insert(0,'/usr/lib/python2.7/dist-packages') ## rospkg | |
import os |
This file contains hidden or 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
import rospy | |
import rosbag | |
import numpy as np | |
import cv2 | |
import message_filters | |
import sys, os | |
from sensor_msgs import point_cloud2 | |
import glob | |
from cv_bridge import CvBridge, CvBridgeError |
This file contains hidden or 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
#!/usr/bin/env python | |
import rosbag | |
import os | |
from shutil import copyfile | |
import glob | |
bags_path = glob.glob('/home/aaa/dataset/*.bag') | |
for bag_file in bags_path: | |
bag = rosbag.Bag(bag_file) |