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
#include <iostream> | |
using namespace std; | |
struct MyStruct | |
{ | |
int x; | |
}; | |
void updateStruct (MyStruct my_struct) | |
{ |
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
>>> centroids | |
[[329, 894], [463, 878], [703, 863], [327, 761], [684, 736], [315, 635], [676, 615]] | |
>>> sorted(centroids,key = lambda s:sum) | |
[[329, 894], [463, 878], [703, 863], [327, 761], [684, 736], [315, 635], [676, 615]] | |
>>> |
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
>>> centroids | |
[[98, 325], [232, 309], [472, 294], [96, 192], [453, 167], [84, 66], [445, 46]] | |
>>> match_pts | |
[[84, 310], [208, 310], [456, 310], [84, 188], [456, 188], [84, 66], [456, 66]] | |
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
.model C,flat | |
.data | |
.code | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; | |
; MMX ASSEMBLY | |
; |
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 cv2,time | |
import numpy as np | |
from multiprocessing.pool import ThreadPool | |
img = cv2.imread('img2.png',0) | |
ret,src = cv2.threshold(img,127,255,0) | |
contours,hierarchy = cv2.findContours(src,cv2.RETR_TREE,cv2.CHAIN_APPROX_NONE) |
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
In [8]: %prun single_process(contours) | |
6000013 function calls in 39.007 seconds | |
Ordered by: internal time | |
ncalls tottime percall cumtime percall filename:lineno(function) | |
3000000 36.424 0.000 36.424 0.000 {cv2.pointPolygonTest} | |
1 2.056 2.056 39.006 39.006 pointpolygontest.py:18(single_process) | |
3000000 0.514 0.000 0.514 0.000 {method 'itemset' of 'numpy.ndarray' objects} | |
4 0.010 0.002 0.010 0.002 {numpy.core.multiarray.zeros} |
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 cv2 | |
import numpy as np | |
from matplotlib import pyplot as plt | |
def drawlines(img1,img2,lines,pts1,pts2): | |
''' img1 - image on which we draw the epilines for the points in img1 | |
lines - corresponding epilines ''' | |
r,c = img1.shape |
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 cv2 | |
import numpy as np | |
from matplotlib import pyplot as plt | |
def drawlines(img1,img2,lines,pts1,pts2): | |
''' img1 - image on which we draw the epilines for the points in img1 | |
lines - corresponding epilines ''' | |
r,c = img1.shape |
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 numpy as np | |
import cv2 | |
from matplotlib import pyplot as plt | |
from mpl_toolkits.mplot3d import axes3d | |
FLANN_INDEX_KDTREE = 0 | |
index_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5) | |
search_params = dict(checks = 50) | |
flann = cv2.FlannBasedMatcher(index_params, search_params) |
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 numpy as np | |
import cv2 | |
import time,sys,os | |
ply_header = '''ply | |
format ascii 1.0 | |
element vertex %(vert_num)d | |
property float x | |
property float y | |
property float z |
OlderNewer