format
This commit is contained in:
parent
eaf7294d06
commit
e7ab3b6c80
|
@ -6,9 +6,7 @@ from tqdm import tqdm
|
|||
import pandas as pd
|
||||
import pcapng
|
||||
from struct import unpack
|
||||
import matplotlib.pyplot as plt
|
||||
from PIL import Image
|
||||
from PIL import Image, ImageDraw
|
||||
import cv2
|
||||
|
||||
|
||||
|
@ -40,6 +38,7 @@ def parse(data):
|
|||
ret['data'] = data[hdr:]
|
||||
return ret
|
||||
|
||||
|
||||
df = pd.DataFrame([parse(d) for d in raw])
|
||||
df2 = df[[c for c in df.columns if c != 'data']]
|
||||
|
||||
|
@ -60,7 +59,10 @@ def getframes(df):
|
|||
|
||||
|
||||
def image16(frame, width, height, pixelformat='>H'):
|
||||
return [Image.fromarray(np.frombuffer(frame, dtype=pixelformat).reshape(width, height)) for frame in frames if len(frame) == 2 * width * height]
|
||||
return [
|
||||
Image.fromarray(np.frombuffer(frame, dtype=pixelformat).reshape(width, height)) for frame in frames
|
||||
if len(frame) == 2 * width * height
|
||||
]
|
||||
|
||||
|
||||
def showvideo(images):
|
||||
|
|
Loading…
Reference in New Issue
Block a user