Title: Image Processing
1Image Processing Computer Vision
2Optical Flow Motion
Optical Flow ?????? ?????????????? ???????????????
?????? ???? ? ???????????? ??? Frame ??? t1 ???
Frame ??? t2
(a) Time t1 (b) Time t2 (c) Optical Flow
3Optical Flow Motion
Example of Application using Optical Flow Motion
4Constraints ?????? Optical Flow ??????????? Gibbs
Sampler
- Data Constraints ? ??????????????????????????
????????????????????? (image intensity)
??????????????????????????? ??????????????????????
? Vector u ??? v - Smoothness Constraints ? ??? u ??? v ??????
smooth ?????????? ?????????????? u ??? v ???
?????????? (neighbor) ??????? ??????????????????
Energy ?xy (It(x,y) - It1(xv(x,y),yu(x,y))
)2 ?(u(x1,y) u(x,y))2
?(u(x,y1)
u(x,y))2
?(v(x1,y) v(x,y))2
?(v(x,y1) v(x,y))2
Data Constraints
Smoothness Constraints
5Algorithm using Gibbs Sampler
- 1. Start Temperature T is high
- 2. Initialize u(x,y) Random -20...20
- Initialize v(x,y) Random -20...20
- 3. For each pixel(x,y)
- For each state Su -2020
- For each state Sv -20..20
- if u(x,y) -20 and v(x,y) -20 E-20,-20
P-20,-20 exp(-E-20,-20/T) - if u(x,y) -20 and v(x,y) -19
E-20,-19 P-20,-19 exp(-E-20,-19/T) - .
- if u(x,y) 20 and v(x,y) 19 E20,19
P20,19 exp(-E20,19/T) - if u(x,y) 20 and v(x,y) 20 E20,20
P20,20 exp(-E20,20/T) - For each Probi Pi / sum(Pi)
- 4. Sample for state S from pdf Probui and Probvi
- u(x,y) State Su v(x,y) State Sv
- 5. Reduce T T 0.9
- 6. Repeat step 3-4 Until E is stable
6Optical Flow Motion using Gibbs Sampler
Framet1
Framet
u and v
Optical Flow
7Example
Framet1
Framet
v value
u value
8Example
Framet1
Framet
Random u value
Random v value
9Image Processing Computer Vision
- Motion From 2D Image Sequence
10Motion Detection Example
Input Image
Image Subtraction
Region of Motion
11Motion Detection Algorithm (????
??????????????????????????? background)
- Input ??? video ?????????? sequence
???????????????? Time (????) ?????????????? Frame
Ft1i,jFtni,j - For all pixelsi,j in current frame
- set Iouti,j 1 if IFti,j IFt1i,j
gt T - ???? Iout ??????????????????? ???????????????????
???????? ??????? Iout ??????????????? ???????
???????????? ??? ????????? ???????????????????????
????? ????????????????????????? - ?? connected components ??? Iout ?????????? blob
coloring ???? ??? projection - ????? Remove ??????????? ? (small region)
??????????????????? ? ???? noise
threshold
12Motion Detection Algorithm (???? background ?????)
- ????? remove ??????????? ? ??? (Size Filtering)
????????????????????????? ???????? - ?????????????????????????????? ????????????????
frame ???????????? ???????????????????????????????
???????????????????????
13Example
Framet1
Framet
Image Subtraction (Iout)
Motion Object
14Example
Framet1
Framet
Image Subtraction (Iout)
Motion Object
15Size Filtering
- Size Filtering ???????????(remove)
????????????????????????????????????????????
Framet ??? Framet1 - ????????????????????????????????????????
threshold(T) ?????????? ??????????????????????????
?????? T ??????????????????????????? ??? set ???
???????????????? ? ????????? ????????
???????????? T20
??????????? ??????????? ? ?? ?????????????
16?????????????? Motion Detection ???
???????????????????????
- ???????? Motion Detection 2D ?????????????????????
????????????????????????????????????? - ????? Motion Detection 2D ????????????????????????
?????????????????????? 360 ????
17????????????????????????????????
Framet
Framet1
Center Area
Center Area
- ?????????????? different image ?????????????? 20
???????????? ???????????????? - ????????? ?????????????????? different image
?????? Frame - -????????????????? pixel ????? ??????????? ,????
?????? ?????? Frame - -??????????????????????? ????????????????????????
?????????????????????? ???? ???? ????, ????
?????? - -?????????????? ???? ???? ???? ???? ???
??????????????????????????????????????
?????????????????? - ??? ????.?.??????? ??????? ????.?.?????? ??????
????.?.??????? ???????????
18???????????????????????????????? (Example)
Framet
????????? 20 ??????????????????
????????????? ????????? 20 ???????
(20 x20)/100 4 - ????????????????????????
4 pixel - ??????????????????????? 4 pixel -
????????????????????? 13 - ???.?. center
13 ??????? ?.?. ????????????
???????????????????? ???
(13x100)/13 100 - ???.?. left 0 ???????
?.?. ???? ????????????????????
(0x100)/13 0 - ???.?. right 0 ???????
?.?. ??? ????????????????????
(0x100)/13 0 ??????? ???????????
Center Area
19???????????????????????????????? (Example)
Framet1
????????? 20 ??????????????????
????????????? ????????? 20 ???????
(20 x20)/100 4 - ????????????????????????
4 pixel - ??????????????????????? 4 pixel -
????????????????????? 13 - ???.?. center 9
??????? ?.?. ???????????? ???????????????????
? ??? (9x100)/13 69.23 -
???.?. left 4 ??????? ?.?. ????
???????????????????? (4x100)/13
30.77 - ???.?. right 0 ??????? ?.?. ???
???????????????????? (0x100)/13
0 ??????? ???????????
Center Area
20???????????????????????????????? (Example)
Framet2
????????? 20 ??????????????????
????????????? ????????? 20 ???????
(20 x20)/100 4 - ????????????????????????
4 pixel - ??????????????????????? 4 pixel -
????????????????????? 13 - ???.?. center 1
??????? ?.?. ???????????? ???????????????????
? ??? (1x100)/13 7.69 -
???.?. left 0 ??????? ?.?. ????
???????????????????? (0x100)/12
0 - ???.?. right 0 ??????? ?.?. ???
????????????????????
(12x100)/13 92.30 ???????
????????????????
Center Area
21????????????????????????????,??????
Top
Top right
Top left
Center
Right
Left
Bottom
Bottom left
Bottom right
???????????????????????? 6 ???? ??? top left,
top, top right, left, center, right, bottom left,
bottom, bottom right
22????????????????????????????,??????(example)
????????? 20 ??????? 20/3 6.67 7 ???????
??????????? 7 pixels ?????????? 7
pixels ??????????????????????? 6 pixels
??????? 10 ??????? 10/3 3.33 3 ???????
?????????? 3 pixels ???????????? 3
pixels ??????????????????????? 4 pixels
23????????????????????????????,??????(example)
Framet
- ???.?. center 2 ??????? ?.?.
???????????????????? (2x100)/27
7.40 - ???.?. right 2 ??????? ?.?.
???????????????????? (2x100)/27
7.40 - ???.?. bottomleft 0 ??????? ?.?.
???????????????????? (0x100)/27
0 - ???.?. bottom 1 ??????? ?.?.
???????????????????? (1x100)/27
3.70 - ???.?. bottomright 1 ??????? ?.?.
???????????????????? (1x100)/27
3.70
- ????????????????????? 27 - ???.?.
topleft 14 ??????? ?.?.
???????????????????? ???
(14x100)/27 51.85 - ???.?. top 1 ???????
?.?. ????????????????????
(1x100)/27 3.70 - ???.?. topright 0
??????? ?.?. ????????????????????
(0x100)/27 0 - ???.?. left 6 ???????
?.?. ????????????????????
(6x100)/27 22.22
???????????????????? topleft