From 7fedb64c474fc8cb3bab62c84801a015fcf275fe Mon Sep 17 00:00:00 2001 From: Mi Zhang Date: Wed, 12 Sep 2012 16:42:19 -0400 Subject: first attempt to draw the cross, succeed randomly --- gui_win.m | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/gui_win.m b/gui_win.m index ea7c947..580cda0 100644 --- a/gui_win.m +++ b/gui_win.m @@ -74,6 +74,7 @@ global image_m; global image_original; global image_cleaned; global image_fitted; +global image_cross; % Initial values background_m = 0; @@ -82,6 +83,7 @@ image_original = 0; image_cleaned = 0; image_fitted = 0; image_name = 'test.png'; +image_cross = 0; isworking = 0; % Don`t show ticks for the minor windows @@ -310,6 +312,7 @@ global isworking; global image_m; global background_m; global image_fitted; +global image_cross; if (isworking == 1) else @@ -407,6 +410,22 @@ h = plot(fit(tcy,:)); set(h,'Color','blue','LineWidth',2); hold off; +%To display the intersection +max1=max(image_m(:)); +image_cross=image_m; + +for y=1:480 + image_cross(y,tcx) = max1; +end; + +for x=1:640 + image_cross(tcy,x) = max1; +end; +image_m=image_cross; + +display_stuff(handles); + + %Here we plot the ideal fitted image @@ -742,6 +761,7 @@ global image_m; global image_original; global image_cleaned; global image_fitted; +global image_cross; if get(handles.radiobutton7,'Value') image_m=image_original; display_stuff(handles); @@ -750,18 +770,26 @@ else if image_cleaned == 0 set(handles.radiobutton7,'Value',1); else - image_m=image_cleaned; - display_stuff(handles); + if image_cross == 0; + image_m=image_cleaned; + display_stuff(handles); + else + image_m = image_cross; + display_stuff(handles); + end; end; else if get(handles.radiobutton9,'Value') if image_fitted == 0 set(handles.radiobutton7,'Value',1); - image_m=image_original; - display_stuff(handles); + if image_m == 0 + else + image_m = image_original; + display_stuff(handles); + end; else image_m=image_fitted; - display_stuff(handles); + display_stuff(handles); end; end; end; -- cgit v1.2.3