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
import numpy as np | |
def intersect2D(Array_A, Array_B): | |
""" | |
Find row intersection between 2D numpy arrays, a and b. | |
""" | |
# ''' Using Tuple ''' # | |
intersectionList = np.asarray([x for x in Array_A for y in Array_B if(tuple(x) == tuple(y))]) | |
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
import numpy as np | |
def intersect2D(Array_A, Array_B): | |
""" | |
Find row intersection between 2D numpy arrays, a and b. | |
Returns another numpy array with shared rows and index of items in A & B arrays | |
""" | |
# [[IDX], [IDY], [value]] where Equal | |
# ''' Using Tuple ''' # | |
IndexEqual = np.asarray([(i, j, x) for i,x in enumerate(Array_A) for j, y in enumerate (Array_B) if(tuple(x) == tuple(y))]).T |
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
import numpy as np | |
import cv2 as cv | |
def medianFilter(x, k): | |
""" | |
Apply a length-k median filter to a 1D array x. | |
Boundaries are extended by repeating endpoints. | |
this is the equivalent of opencv Median for 2D array | |
""" | |
if k == 1 : |
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
#!/usr/bin/env python3 | |
import numpy as np | |
from PIL import Image | |
import imageio | |
import OpenEXR | |
import struct | |
import os | |
def get_pointcloud(color_image,depth_image,camera_intrinsics): |