import numpy as np
import cv2
cap = cv2.VideoCapture("slow.avi")
while not cap.isOpened():
cap = cv2.VideoCapture("slow.avi")
cv2.waitKey(1000)
print "Wait for the header"
# params for ShiTomasi corner detection
feature_params = dict( maxCorners = 100,
qualityLevel = 0.3,
minDistance = 7,
blockSize = 7 )
# Parameters for lucas kanade optical flow
lk_params = dict( winSize = (15,15),
maxLevel = 2,
criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03))
# Create some random colors
color = np.random.randint(0,255,(100,3))
# Take first frame and find …Run Code Online (Sandbox Code Playgroud) 在select子句中,可以在select子句中指向其他级别对象,或者是否有任何特殊关键字指向.如果不是,我怎么能用select子句解决这个问题.
list.Select(o => new ParentClass {
ID = o.ID,
ChildClass = o.Childs.Select(p => new ChildClass {
Parent = @this,
ID = p.id
}).ToList()
});
Run Code Online (Sandbox Code Playgroud)