Developing a gui for optimization of image correlation (Matlab) -
i programming novice (just started using matlab month ago), apologize if asking lot.
basically, being asked to:
- develop approach scoring image match between 2 images
- develop geometric shape program in matlab generate synthesis images few parameters
- develop gui run global optimization toolbox
i able complete first 2 tasks. first one, use function "corr2" compute correlation between 2 images. second task, wrote program outputs shaded red upside down isosceles triangle. here code wrote:
function [ output_args ] = trianglefit( x,y,m ) % script finds vertices of inverted triangle % 3 input, 3 output x_2 = (m^2 / (1 + m^2))^(0.5) + x; y_2 = m * (x_2 - x) + y; x_3 = -(m^2 / (1 + m^2))^(0.5) + x; % (x_2 , y_2) = right vertex of triangle % (x_3 , y_3) = left vertex of triangle % y_2 = y_3 axis([x_3-2 x_2+2 y-2 y_2+2]); patch([x x_2 x_3],[y y_2 y_2],'red') axis off end
i'm stuck on task #3. being asked use global optimization toolbox find best x,y, , slope combination in order generate model triangle image. comparing model image random image of upside down triangle found on internet. don't have idea how go doing this. if of guys assist me, great.
welcome matlab!
to clear, not place answers on homework. however, recommend take @ guide, matlab gui-building software. following these tutorials, should relatively simple add couple of buttons call functions , plot results.
you need defined couple of things toolbox, let on own. should define objective function, maximized when triangle image matches image you've been given. recommend making matrix has values 1 or 0 depending on whether or not within triangle , compare values in matrix pixels in image. function can fed optimization toolbox along upper , lower bounds variables. toolbox run until images equal possible. leave (since it's assignment).
Comments
Post a Comment