当前位置:网站首页>[optical flow] - data format analysis, flowwarp visualization
[optical flow] - data format analysis, flowwarp visualization
2022-07-27 05:18:00 【Nongfu mountain spring 2】
Optical flow
1. data format
Optical flow data is not easy to label , At least we haven't seen the method of optical flow annotation . General , Optical flow represents , The movement of the same pixel , Forward optical flow is t -> t+1 Of , So when visualizing optical flow , The outline of the object and t The time is consistent . Backward optical flow is generally defined as :t - > t-1.
Open source optical flow data has many formats , However, generally, examples of data analysis are provided , Just read and parse by example . The data of optical flow is :HxWx2,H,W Respectively represent the height and width of the image ,2 It means that x,y Number of moving pixels in the direction . meanwhile , The movement here is based on the current point .
Here to sintel Visualize a picture in the dataset .
The first picture is 0.5 x img1 + 0.5 x img2.
The second picture is optical flow visualization .
2. flow warp
How to check the correctness of data when you get an open source optical flow data set ? How to combine optical flow and pictures for intuitive visualization ?
flow warp It is to sample pictures according to optical flow . Here we use cv2.remap To implement .
code:
step :
- according to h, w Generate benchmark matrix , Be careful grid It's a HxWx2 Matrix , The last dimension 2, Express [x, y] Displacement in direction . The following is right grid Printing of partial values .

- grid + flow, obtain warp Required optical flow .
- Last use opencv Of remap sampling , obtain warp The image after .
- here warp The image is img1, still img2 Well ? Should use the img2 Come on warp, because new_flow Is in img2 Position of pixels in . So the whole thing warp It's from img2 According to the forward optical flow warp To img1 The process of .
visualization :
The first picture is img1
The second picture is img2 warp Got img1
Why? warp Got img1 There are ghosting ?
because :new_flow = grid + flow,grid Is the base point matrix ,flow by [0, 0] when ,remap when , Will collect the original points .flow Not for 0 when , Will be based on new_flow sampling .
边栏推荐
猜你喜欢

Li Kou achieved the second largest result

探寻通用奥特能平台安全、智能、性能的奥秘!

Jmeter 界面如何汉化?

A math problem cost the chip giant $500million

JVM上篇:内存与垃圾回收篇十二--StringTable

Translation of robot and precise vehicle localization based on multi sensor fusion in diverse city scenes

Read write separation and master-slave synchronization

Use ngrok for intranet penetration

34. Analyze flexible.js

JVM Part 1: memory and garbage collection part 10 - runtime data area - direct memory
随机推荐
Knapsack problem DP
Advantages of smart exhibition hall design and applicable industry analysis
When using Photoshop, the prompt "script error -50 general Photoshop error appears“
How idea creates a groovy project (explain in detail with pictures and texts)
B1028 人口普查
B1027 打印沙漏
How does PS import LUT presets? Photoshop import LUT color preset tutorial
TypeScript 详解
Introduction to MySQL optimization
使用Druid连接池创建DataSource(数据源)
使用ngrok做内网穿透
MySQL storage engine and its differences
How to test the payment process?
"Photoshop2021 tutorial" adjust the picture to different aspect ratio
pyside2____ 1. Installation and case listing
文件对话框
Sub database and sub table
35. Scroll
辗转相除法
B1023 组个最小数