MATLAB: Haunted Code (Serious)

guisolved

I know this might sound like a joke but I promise I am being completely serious. I want to preface this question by saying that I don't need help fixing this code, I've rewritten it and it works fine now. I am simply looking to see if anyone knows why this is happening or if it has happened to anyone else
I've been trying to create a GUI where I can click a button, use it to select an image, and then display that image on an axes. All was going well but when I went to test the code (as follows), the image loaded with a small blue square in the corner. Looking closer at that box, I found that there is an image of what appears to be a young boy smiling (3 images attached below show him appearing on 2 different images and then one zoomed in on him). He appears on every image I've tried, in various sizes. I am 99% certain this is not an image from my local storage; my device is brand new and I cannot fathom as to why I would have such an image saved somewhere.
% --- Executes on button press in LoadButton.
function LoadButton_Callback(hObject, eventdata, handles)
% hObject handle to LoadButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename, path]=uigetfile('*.jpg','Select an Image')
fullfilename=fullfile(path,filename)
Image= imread(fullfilename);
image(Image,'Parent',handles.Image);
set(handles.Image,'visible');
imshow(image);
If anyone has any idea what's going on please let me know.

Best Answer

That is the default image upside down. You can view it by calling just
>> image
When you call
imshow(image);
MATLAB first evaluates image and shows the default image in the current axes. I believe it then tries to call imshow() on the output of image, which is an Image object, and so it should throw an error (it does for me). You will see the blue kid in the corner (and the error) with the following three lines:
Image = imread('pears.png');
image(Image);
imshow(image);
The image is actually first being plotted with the call to image() - you don't need the third line.
I'm assuming handles.Image is supposed to be the axes where you are plotting your image. How about this instead?
Image = imread(fullfilename);
image(handles.Image, Image); % or, imshow(Image, 'Parent', ax); if you'd like
(edit) And it's not just a boy :)