Example dataflow and queries used in the paper.
Dataflow and user query 2: Traffic violation
- USING Optasia;
-
- rawframes =
- EXTRACT vid : int, //camera/video id
- fid : int, //frame id
- cid : int, //chunk id
- frame : string //video frame
- FROM SPARSE STREAMSET @"/my/v_wsdot/"
- PATTERN @"t_%n.avi"
- RANGE __serialnum = ["1","100"]
- USING VideoExtractor("300", "50");
-
- //Estimate traffic flow
- counter =
- REDUCE rawframes
- ON vid, cid
- PRODUCE vid,
- fid,
- patch, //image patch for detected vehicles
- inbox, //vehicles passing which entry box
- fid_in, //time to pass the entry box
- outbox, //vehicles passing which exit box
- fid_out //time to pass the exit box
- USING TrackingReducer("L_lane_in,M_lane_in,R_lane_in", "L_lane_out,M_lane_out,R_lane_out", "MercerSt.tif");
-
- //Extract HOG feature
- features_HOG =
- PROCESS counter
- USING FeatureProcessor("HOG:dimh=64,dimw=64")
- PRODUCE vid,
- fid,
- Feature;
-
- //Extract RGB histogram feature
- features_RGBHIST =
- PROCESS counter
- USING FeatureProcessor("RGBHIST:size=10")
- PRODUCE vid,
- fid,
- Feature;
-
- //Combine features
- features_CarClassification =
- REDUCE
- (
- SELECT *
- FROM features_HOG
- UNION
- SELECT *
- FROM features_RGBHIST
- )
- ON vid, fid
- USING FeatureReducer;
-
- //Apply classifier and predict vehicle type labels
- labels_CarClassification =
- PROCESS features_CarClassification
- USING ClassifierProcessor(@"vehicle.model")
- PRODUCE vid,
- fid,
- label,
- confidence;
-
- results =
- SELECT counter.*,
- labels_CarClassification.*
- FROM counter
- INNER JOIN
- labels_CarClassification
- ON counter.fid == labels_CarClassification.fid
- AND counter.vid == labels_CarClassification.vid
- WHERE inbox == "L_lane_in" AND outbox == "R_lane_out"
- AND labels_CarClassification.label == "truck";