A for red, B for green, C for yellow and D for blue. Can you please help me out with this?
The text should appear in the textbox. Expected output is: ADBCD
function upload_Callback(hObject, eventdata, handles)
[File_Name, Path_Name]=uigetfile('D:\'); %browse to upload image on clicking "upload" button
axes(handles.graph);
fullname=fullfile(Path_Name,File_Name);
read_image=imread(fullname); %read the uploaded image
show_image=imshow(fullname); %display the image on the axes
function decode_Callback(hObject,eventdata,handles)
upload; %calling the upload function to get the uploaded image
letters={'A','B','C','D'}
cmap=[1 0 0; %red
0 1 0; %green
1 1 0; %yellow
0 0 1]; %blue
lettermap=rgb2ind(read_image,cmap);
letterimg=letters(lettermap);
set(handles.output,'string',letterimg); %display the text in the textbox
The output is not obtained. Would you please help me with this?