這個(gè)怎么理解。是交通標(biāo)志識(shí)別的。求求大佬告訴一下
function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%% 提取標(biāo)志% 按照顏色來(lái)分Color = 0; % 顏色標(biāo)記 1是紅 2 是藍(lán) 3是黃色if get(handles.radiobutton3,'Value') Color = 1; elseif get(handles.radiobutton4,'Value') Color = 2; elseif get(handles.radiobutton5,'Value') Color = 3;endhandles.Color = Color;Image = handles.I;switch Color case 1 DI = Image(:,:,1); GI = (Image(:,:,1)>110 & Image(:,:,2)<150 & Image(:,:,3)<150 ... & abs(double(Image(:,:,2))-double(Image(:,:,3)))<50 & abs(double(Image(:,:,1))-double(Image(:,:,2)))>30); case 2 DI = Image(:,:,3); GI = (Image(:,:,1)<100 & Image(:,:,2)<150 & Image(:,:,3)>120 ... & abs(double(Image(:,:,2))-double(Image(:,:,3)))>30); case 3 DI = rgb2gray(Image); GI = (Image(:,:,1)>160 & Image(:,:,2)>90 & Image(:,:,3)<90 ... & abs(double(Image(:,:,1))-double(Image(:,:,2)))<100 & abs(double(Image(:,:,1))-double(Image(:,:,3)))>90); endaxes(handles.axes2);imshow(DI);axes(handles.axes3);imshow(GI);handles.GI = GI;guidata(hObject, handles); % --- Executes on button press in pushbutton3. |