image retargeting
play

Image Retargeting Shai Avidan Tel Aviv University Bidirectional - PowerPoint PPT Presentation

Image Retargeting Shai Avidan Tel Aviv University Bidirectional Similarity (Simakov et al. 2008) The Bidirectional (dis)similarity measure for images S and T: Goal: Given S, find T s.t. min d(S,T) Bidirectional Similarity The error


  1. Image Retargeting Shai Avidan Tel Aviv University

  2. Bidirectional Similarity (Simakov et al. 2008) The Bidirectional (dis)similarity measure for images S and T: Goal: Given S, find T s.t. min d(S,T)

  3. Bidirectional Similarity � The error term is the contributi on of the pixel q T to the global bidirectio nal error 1 1 � � � � � � � � � � � � � � � � � � n m � � 2 � � 2 ˆ Err T q S p T q S p T q i i � � N j 1 N i 1 S T � � � The error a pixel q T contribute s to d S , T : � � � complete The error a pixel q T contribute s to d S , T : cohere ˆ ˆ Let Q ,..., Q denote all patches in T that contain pixel q Let Q ,..., Q denote all patches in T that contain pixel q 1 n 1 m and serve as " the most similar patch" to some patches Let P ,..., P denote the correspond ing matches in S 1 m � � � � � � � � ˆ ˆ ˆ ˆ ˆ � � � � � � P ,..., P in S i.e., P S s.t. Q arg min D P , Q � i.e., P arg min D P , Q � � � 1 n j j j i i � � � � � � P S Q T Let p ,..., p be the pixels in P ,..., P correspond ing ˆ ˆ Let p ˆ ,..., p ˆ be the pixels in P ,..., P correspond ing 1 m 1 m 1 n 1 m to the position of pixel q in Q ,..., Q Then ˆ ˆ to the position of pixel q in Q ,..., Q Then 1 m 1 m 1 � � � � � � � � m � 2 1 S p T q � � � � � � � � n 2 � S p ˆ T q i N i 1 i N j 1 T S � is the contributi on of the color of pixel q T � is the contributi on of the color of pixel q T � � to the term d S , T � � to the term d S , T cohere complete � � � � � � Taking derivative of Err T q with respect to the unknown color T q and equating to zero, we get the update rule : 1 1 � � � � � � n m � S p ˆ S p i i N j � 1 N i � 1 � � � T q S T n m � N N S T

  4. Shift-Map • Shift-Maps represent a mapping for each pixel in the output image into the input image � M(u,v) (t ,t ) x y • The color of the output pixel is copied from corresponding input pixel

  5. Our Approach : Shift-Map � M(u,v) (t ,t ) x y � � � � R ( u , v ) I ( u t , v t ) I ( x , y ) x y � M(u,v) (t ,t ) x y • We use relative mapping coordinate (like in Optical Flow)

  6. Our Approach : Shift-Map • • •

  7. Geometric Editing as an Energy Minimization • We look for the optimal mapping - can be described as an Energy Minimization problem � � � � E ( M ) E ( M ( p )) E ( M ( p ), M ( q )) d s � � p R p , q N • •

  8. The Smoothness Term • Assigns a penalty to a discontinuity introduced to the output image by a discontinuity in the Shift-Map This term will minimize editing artifacts and create good stitching in the output image • Discontinuities are computed based on color differences and gradient differences (preserve image structure)

  9. The Smoothness Term R - Output Image I - Input Image p’ q’ p q No discontinuity in the shift-map � ! � M ( p ) M ( q ) E ( M ( p ), M ( q )) 0 s

  10. The Smoothness Term R - Output Image I - Input Image n p’ p’ n q’ p q q’ D iscontinuity in the shift-map � ! � M ( p ) M ( q ) E ( M ( p ), M ( q )) 0 s # ! � M ( p ) M ( q ) E ( M ( p ), M ( q )) s � � � � � 2 2 ( I ( n ) I ( q ' )) ( I ( n ) I ( p ' )) p ' q ' " � " � " � " 2 2 ( I ( n ) I ( q ' )) ( I ( n ) I ( p ' )) p ' q '

  11. The Data Term: Retargeting • Use picture borders • Can incorporate importance mask – Order constraint on mapping is applied to prevent duplications of important areas

  12. Shift-Map as Graph Labeling • Minimal energy mapping can be represented as graph labeling where the Shift-Map value is the selected label for each output pixel • Label s: relative shift

  13. Shift-Map as Graph Labeling • Minimal energy mapping can be represented as graph labeling where the Shift-Map value is the selected label for each output pixel • Label s: relative shift

  14. ✩ ✡ ✄ � ✁ Labels and Nodes Range # Nodes : number of pixels in the image # Labels : number of possible shifts • Retargeting: – Horizontal shifts: change in width – Vertical shifts: optional - add limited range External Constraint s : � � � � � � % � � � 0 u t x v t y � � � x y E M ( u , v ) � D $ otherwise � Saliency constraint s : Large S means low importance � � � � � E M ( u , v ) S ( u t , v t ) D x y Order Constraint s : � � � � � � � � � Let M ( u , v ) t , t and M ( u 1 , v ) t , t x y x y � & � 1 t t � � � � � � x x E M ( u , v ), M u 1 , v � S $ otherwise � Multiply by the smoothness term to prevent discontinu ity

  15. Optimal Labeling Using Graph Cuts • Global minimization of the energy is NP- hard • We use approximate techniques : Graph Cuts based expansion moves Fast Approximate Energy Minimization via Graph Cuts, [Boykov, Veksler, Zabih, PAMI 2001]

  16. Hierarchical Solution

  17. Hierarchical Solution • This is an approximate solution –leading to local minimum –many of the theoretical guarantees of the “alpha expansion” algorithm are lost in practice we get good results Computation time is seconds

  18. Results and comparison

  19. Results and Comparison Input

  20. Results and Comparison

  21. Results and Comparison Input

  22. Results and Comparison

  23. Results and Comparison Input

  24. Results and Comparison Optimized Scale Improved Video-Retargeting Shift-Maps and Stretch Seam Carving

  25. Results and Comparison Input

  26. Results and Comparison

  27. When does it fail and why?

  28. Forward Energy

  29. Results

  30. Results

  31. Results

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend