私はコインの画像を取り込んで、Matlabの能力を最大限発揮するプログラムを作成しました(以下の例)。このプログラムでは、画像処理を試してみたいと思います.Googleイメージと同様に、画像を検索して類似していると思われる結果を返すことができます。Matlab - 結果を自動的に生成
Application Image | Further Application Image Example
これを行うには、これを達成するために、アプリケーションのスライダを手動で使用し、各画像の50〜100の結果を生成するには時間がかかります。そこで私は100の結果を生成する新しいボタンを作成することにしました。それぞれの結果は異なる描画サンプルを提供します。上記
function slider2_Callback(hObject, eventdata, handles)
% hObject handle to slider2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global coins_gray;
global num;
val=0.5*get(hObject,'Value')-0.5; %Adjusts the intensity of the slider's brightness setting
imbrightness = coins_gray+val;
axes(handles.axes3);
imshow(imbrightness);
title('Altered Coin Image', 'fontweight', 'bold');
[~, threshold] = edge(imbrightness, 'Canny');
fudgeFactor = num;
img_edge = edge(imbrightness, 'Canny', threshold * fudgeFactor);
axes(handles.axes4)
imshow(img_edge);
title('User Drawn Image', 'fontweight', 'bold');
はスライダーがどのように機能するかを示しているが、私は私が述べてきたかのように自動的に動作するように適応するかどうかはわかりません。
function gatherbutton_Callback(hObject, eventdata, handles)
% hObject handle to gatherbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Prompts the user to enter a title for the image gathering process
prompt = ('Please Enter The Image Name (Do Not Include File Extension): ');
userInput = input(prompt, 's');
counter = 0
while counter < 100:
processFolder = sprintf('M:/Project/MatLab/Coin Image Processing/Image Processing/%s_%s.jpg', userInput, counter);
referenceImagePrep = getframe(handles.axes3);
drawnImagePrep = getframe(handles.axes4);
counter = counter + 1;
end
これは私がこれまで行ってきたことです。したがって、ループは100回実行する必要があり、実行するたびに新しいイメージが指定のディレクトリに保存され、whileループが完了するまで続ける必要があります。だから私は今どのように自動的に参照画像の明るさを変更し、指定されたフォルダにその画像を格納する私のwhileループを適応させることができます。