26

FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING FINAL PRESENTATION CprE 583, Fall 2011

  • Upload
    ardice

  • View
    44

  • Download
    0

Embed Size (px)

DESCRIPTION

FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING FINAL PRESENTATION CprE 583, Fall 2011. Project T eam. Talha Ansari, Technical Approach/VHDL implementation Heather Garnell, Technical Approach/VHDL implementation Anamika Shams, Testing Requirements/Implementation. Motivation. - PowerPoint PPT Presentation

Citation preview

Page 1: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011
Page 2: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

Talha Ansari,Technical Approach/VHDL implementation

Heather Garnell, Technical Approach/VHDL implementation

Anamika Shams, Testing Requirements/Implementation

Page 3: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• Image morphing is a useful and widely recognized visualization technique.  Thus there is interest in and research conducted in this area.

• Image morphing techniques can generate compelling 2-D transitions between images and thus will add an element to fun to the entire project development process.

Page 4: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• To implement image morphing on the ML507 test board using both the xilinx FPGA and the PPC 440

• From Iowa State CprE583 Fall 2011 lecture 12

Page 5: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• The final product will include two similar images and a final morphed image similar to the images you see below.

Page 6: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011
Page 7: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011
Page 8: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• The concept of Barycentric Coordinates can be used in an image morphing application

http://www.cs.washington.edu/homes/ankit/course_projects/files/DIP/A2_web/marked6.jpg

Page 9: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

compute_ABCts

find_bary_coordinate

compute_alpha

main

write

bary

read

compute_gamma

compute_beta get_tri_area

Page 10: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

•Compute_ABCts: This function compute time interpolation of ABC_0 and ABC_1 for AtBtCt triangle •by looping through 8 triangle, 3 points of each triangle and the 2 coordinate of the each triangle•Get_Tri_Area: This method is getting the area of the corresponding point P1, P2 and P3 of the new •triangle.•Compute_Alpha: This function compute the new triangle area in regards to ABC triangle and PBC •triangle•Compute_Beta: This function compute the new triangle area in regards to ABC triangle and PAC•triangle•Compute_Gamma: This function compute the new triangle area in regards to ABC triangle and PAB•triangle.•Find_Bary_Coordinate: This function find two coordinate points x and y from the ABC triangle area.•Bary: This method is computing the morphed triangle at time t where due to the affine invariant •property, the corresponding point Po in triangle AoBoCo and PI in triangle A,BICI are Po = atAo + •BtBo + YtCO and PI = atA I + BtBI + YtC" respectively. If the colors of Po and PI are I0 and I1,•respectively, the color at Pt will be computed same as simply using this function It = (l-t)Io + tIl. •Therefore, every pixel of triangle AtBtCt is interpolated from its initial color in triangle AoBoCo and its•final color in triangle AIBICI.•Read: This method open the bmp file and read the header and the color of two images files and then•close the file.•Write: This function open the final morphed image file and write the morphed image.

Page 11: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• To reuse MP3 architecture as much as possible• Offload PPC with pixel morphing

• Load 120 bits (5 pixels) from each picture in two consecutive loads• Take average of each pixel element• Send modified data back to PPC

Page 12: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011
Page 13: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011
Page 14: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• Step 1: Design C code on local computer and test out• Step 2: Design VHDL merging function and test out• Step 3: Integrate C code on PPC• Step 4: Integrate VHDL code by offloading pixel merging to

FPGA• Step 5: Test system out

Page 15: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• Complete C code implementation

alpha = compute_alpha(ABC_t, uv); beta = compute_beta (ABC_t, uv); gamma = compute_gamma(ABC_t, uv);

// Let Pt be a point of triangle AtBtCt. // Its barycentric coordinate with respect to triangle AtBtCt, can be found as // Pt = ætAt + ßtBt + YtCt where æt/=0, ßt/=0, Yt/=0, æt+ßt+Yt=1 Pt = find_bary_coordinate(alpha, beta, gamma, ABC_t); // From the coordinate (æt, ßt, Yt) of point Pt, due to the affine // invariant property, the corresponding point // P0 in triangle AøBøCø = ætAø + ßtBø + YtCø // P1 in triangle A1B1C1 = ætA1 + ßtB1 + YtC1 P0 = find_bary_coordinate(alpha, beta, gamma, ABC_0); P1 = find_bary_coordinate(alpha, beta, gamma, ABC_1);

// If the colors of P0 and P1 are I0 and I1, respectively, // the color at Pt is simply: It = (1-t)I0 + tI1

// Compute It for red, green, and blue pixels temp_red = (1.0-t)*(float)(I0.red) + t*(float)(I1.red); // Red temp_grn = (1.0-t)*(float)(I0.grn) + t*(float)(I1.grn); // Green temp_blu = (1.0-t)*(float)(I0.blu) + t*(float)(I1.blu); // Blue SINGLE_PIXEL It = { (int)(temp_red), (int)(temp_grn), (int)(temp_blu) };

Page 16: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

It is important for images to be the same size and orientation.

Source images were chosen because they met this criteria.

Page 17: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• Each of the two input images broken into eight triangles

Page 18: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

Final morphed image based on the previous slide’s two images

Page 19: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• VHDL implementation complete

Page 20: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• Currently at this step of integration• Minor issues with integration of current c code into out echo.c

Page 21: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• Next step

Page 22: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• This is where magic happens!!!

Page 23: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

Ching-Kuang Shene. "Barycentric Coordinates and Morphing,” Department of Computer Science. Michigan Technological University. April 19, 2003.- This is a practical guide for implementing barycentric coordinates into an image morphing application.  T. Balercia, A. Zitti, H. Francesconi, S. Orcioni and M. Conti. "FPGA Implementations of a Simplified Retinex Image Processing Algorithm." IEEE 2006.

Page 24: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• Resolve issue with final morphing of pixel data within c code• as this the morphing algorithm itself was not the purpose of the

project, we chose to resolve this between now and final submission

• Complete integration effort

• Modify documentation based on any recent changes to project design or implementation

• Complete writing the final report

Page 25: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

• Set times when the entire group can meet to discuss topics proved to be difficult with work schedules and family issues.

• Use of chat programs was very helpful to keep communication lines open

• Use of tools to keep documentation in a common location was helpful (Google docs and Google sites)

• Check for integration issues early on is important

Page 26: FPGA-BASED HARDWARE EMULATION OF IMAGE MORPHING  FINAL PRESENTATION CprE  583, Fall 2011

Thank you!