Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
display image for comparison

Subject: display image for comparison

From: Bismillah Kani

Date: 18 Jun, 2010 16:50:19

Message: 1 of 10

hi,
i need to display two images (left and right) more specifically color swatch for comparison. the display should be fullscreen with no other images displaying like scroll bar, filename etc. the right image should be able to changed by the user while the left one is fixed. this is for an experiment that i am going to conduct with different users for finding the color difference.

Subject: display image for comparison

From: ImageAnalyst

Date: 18 Jun, 2010 20:29:45

Message: 2 of 10

I don't know that that is possible. As far as I know, you're always
going to have the titlebar and the window border at a minimum, and
usually some blank space between the edge of the image (which is in an
"axes" control) and the edge of the figure window. And if you're
using WIndows, you may have the task bar along the bottom of the
screen (unless you set it to auto-hide). What operating system are
you using?

Subject: display image for comparison

From: us

Date: 18 Jun, 2010 20:45:23

Message: 3 of 10

"Bismillah Kani " <bismillahkani@gmail.com> wrote in message <hvg84b$ku9$1@fred.mathworks.com>...
> hi,
> i need to display two images (left and right) more specifically color swatch for comparison. the display should be fullscreen with no other images displaying like scroll bar, filename etc. the right image should be able to changed by the user while the left one is fixed. this is for an experiment that i am going to conduct with different users for finding the color difference.

one of the solutions

     i1=.80*rand(5,3,3);
     i2=rand(5,7,3);
     img=[i1,i2];
     itf=[false(size(i1)),true(size(i2))];
     ih=image(img);
     axis image;
     axis off;
for i=1:10
     imn=rand(size(i2)); % <- your new image...
     img(itf)=imn;
     set(ih,'cdata',img);
     pause(.25); % <- change display speed...
end

us

Subject: display image for comparison

From: ImageAnalyst

Date: 18 Jun, 2010 22:22:00

Message: 4 of 10

us:
I'm not seeing it. I see a bunch of color patches (not just two), and
there is also a figure window with border, a toolbar, and a bunch of
gray blank space around the colored patches, not to mention all the
other stuff on the screen including other applications, the Windows
taskbar and desktop background. I think he wants to do a
psychophysical study (probably in a darkened room) where there is
NOTHING, absolutely nothing, on the screen except the two color
patches, each taking up half the entire screen. The user would swap
out the right half color patch with a new one by hitting the spacebar
or something. In Windows, you could do this with DirectX but I don't
know how to do this from MATLAB.

Subject: display image for comparison

From: us

Date: 18 Jun, 2010 22:40:23

Message: 5 of 10

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <8fc6ade1-8c8d-4f3f-be47-1231619d5ef0@b7g2000vbl.googlegroups.com>...
> us:
> I'm not seeing it. I see a bunch of color patches (not just two), and
> there is also a figure window with border, a toolbar, and a bunch of
> gray blank space around the colored patches, not to mention all the
> other stuff on the screen including other applications, the Windows
> taskbar and desktop background. I think he wants to do a
> psychophysical study (probably in a darkened room) where there is
> NOTHING, absolutely nothing, on the screen except the two color
> patches, each taking up half the entire screen. The user would swap
> out the right half color patch with a new one by hitting the spacebar
> or something. In Windows, you could do this with DirectX but I don't
> know how to do this from MATLAB.

ia:
of course(!)... and i certainly realized that he/she wants to do a psyphys experiment...

all i showed was the SKELETON of how the OP could quickly change one (or more) parts of a combined image (i probably should have made this more clear, sorry!)...

naturally, he/she would have to do this
- replace I1 with the actual still image...
- replace IMN with the new image, eg,
  a randomly selected bitmap from a stack of preloaded images (eg, faces, scenes)...
- replace the PAUSE statement with a smart KEYPRESS function...
- adjust the FIGURE size to full-screen (see another recent OP)...

i've created a complete test suite for our (similar) npsy experiments (including fancy acoustics, timing, timeout, and much more) based on this very (simple) engine...

us

Subject: display image for comparison

From: ImageAnalyst

Date: 18 Jun, 2010 22:48:28

Message: 6 of 10

I guess you could get rid of the windows task bar by setting it to
autohide, and you could set the 'menubar' and 'toolbar' properties of
the figure window to 'none', but how do you get rid of the MATLAB
figure's title bar, and the border to the figure window?

Subject: display image for comparison

From: us

Date: 18 Jun, 2010 23:29:05

Message: 7 of 10

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <54113a1a-1f03-40f1-87ec-614e6e74901a@18g2000vbi.googlegroups.com>...
> I guess you could get rid of the windows task bar by setting it to
> autohide, and you could set the 'menubar' and 'toolbar' properties of
> the figure window to 'none', but how do you get rid of the MATLAB
> figure's title bar, and the border to the figure window?

one of the solutions

% get rid of window's task bar...
     figure;
     set(gcf,'toolbar','none','menubar','none');
     sp=get(0,'screensize');
     set(gcf,'position',[-10,500,sp(3)+10,600]);
% note: this is just a quick-and-dirty example; we use java calls to determine the
% frame layout...
% then, we adjust the figures contents to the visible part of the canvas...

us

Subject: display image for comparison

From: Bismillah Kani

Date: 19 Jun, 2010 17:40:22

Message: 8 of 10

"us " <us@neurol.unizh.ch> wrote in message <hvgskn$kop$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <8fc6ade1-8c8d-4f3f-be47-1231619d5ef0@b7g2000vbl.googlegroups.com>...
> > us:
> > I'm not seeing it. I see a bunch of color patches (not just two), and
> > there is also a figure window with border, a toolbar, and a bunch of
> > gray blank space around the colored patches, not to mention all the
> > other stuff on the screen including other applications, the Windows
> > taskbar and desktop background. I think he wants to do a
> > psychophysical study (probably in a darkened room) where there is
> > NOTHING, absolutely nothing, on the screen except the two color
> > patches, each taking up half the entire screen. The user would swap
> > out the right half color patch with a new one by hitting the spacebar
> > or something. In Windows, you could do this with DirectX but I don't
> > know how to do this from MATLAB.
>
> ia:
> of course(!)... and i certainly realized that he/she wants to do a psyphys experiment...
>
> all i showed was the SKELETON of how the OP could quickly change one (or more) parts of a combined image (i probably should have made this more clear, sorry!)...
>
> naturally, he/she would have to do this
> - replace I1 with the actual still image...
> - replace IMN with the new image, eg,
> a randomly selected bitmap from a stack of preloaded images (eg, faces, scenes)...
> - replace the PAUSE statement with a smart KEYPRESS function...
> - adjust the FIGURE size to full-screen (see another recent OP)...
>
> i've created a complete test suite for our (similar) npsy experiments (including fancy acoustics, timing, timeout, and much more) based on this very (simple) engine...
>
> us

Hi,

Many thanks for your post. Can you please give me the complete implementation of code for me to use in my experiment. I am trying hard to get this fixed but am very poor in programming basically. I am a color science guy. Your code will be very helpful for me.

Bis

Subject: display image for comparison

From: Yair Altman

Date: 19 Jun, 2010 20:58:05

Message: 9 of 10

"us " <us@neurol.unizh.ch> wrote in message <hvgvg1$crb$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <54113a1a-1f03-40f1-87ec-614e6e74901a@18g2000vbi.googlegroups.com>...
> > I guess you could get rid of the windows task bar by setting it to
> > autohide, and you could set the 'menubar' and 'toolbar' properties of
> > the figure window to 'none', but how do you get rid of the MATLAB
> > figure's title bar, and the border to the figure window?
>
> one of the solutions
>
> % get rid of window's task bar...
> figure;
> set(gcf,'toolbar','none','menubar','none');
> sp=get(0,'screensize');
> set(gcf,'position',[-10,500,sp(3)+10,600]);
> % note: this is just a quick-and-dirty example; we use java calls to determine the
> % frame layout...
> % then, we adjust the figures contents to the visible part of the canvas...
>
> us

The figure's title bar and borders are set by the current look-and-feel's so-called decoration. Unfortunately, Java prevents removing window decorations after the window has been displayed, and we cannot access the figure's Java components before the window is displayed, so that's a bit of a catch-21. You can try playing around with your Java L&F's properties, but this is not for the faint-hearted...

Theoretically, we can create another undecorated pure-Java JFrame and move all the Matlab figure's content onto this new (undecorated) JFrame. In practice, however, there are many problems when implementing this (listeners set and used by Matlab etc.).

Yair Altman
http://UndocumentedMatlab.com

Subject: display image for comparison

From: Bismillah Kani

Date: 20 Jun, 2010 07:41:05

Message: 10 of 10

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <hvjb0t$raa$1@fred.mathworks.com>...
> "us " <us@neurol.unizh.ch> wrote in message <hvgvg1$crb$1@fred.mathworks.com>...
> > ImageAnalyst <imageanalyst@mailinator.com> wrote in message <54113a1a-1f03-40f1-87ec-614e6e74901a@18g2000vbi.googlegroups.com>...
> > > I guess you could get rid of the windows task bar by setting it to
> > > autohide, and you could set the 'menubar' and 'toolbar' properties of
> > > the figure window to 'none', but how do you get rid of the MATLAB
> > > figure's title bar, and the border to the figure window?
> >
> > one of the solutions
> >
> > % get rid of window's task bar...
> > figure;
> > set(gcf,'toolbar','none','menubar','none');
> > sp=get(0,'screensize');
> > set(gcf,'position',[-10,500,sp(3)+10,600]);
> > % note: this is just a quick-and-dirty example; we use java calls to determine the
> > % frame layout...
> > % then, we adjust the figures contents to the visible part of the canvas...
> >
> > us
>
> The figure's title bar and borders are set by the current look-and-feel's so-called decoration. Unfortunately, Java prevents removing window decorations after the window has been displayed, and we cannot access the figure's Java components before the window is displayed, so that's a bit of a catch-21. You can try playing around with your Java L&F's properties, but this is not for the faint-hearted...
>
> Theoretically, we can create another undecorated pure-Java JFrame and move all the Matlab figure's content onto this new (undecorated) JFrame. In practice, however, there are many problems when implementing this (listeners set and used by Matlab etc.).
>
> Yair Altman
> http://UndocumentedMatlab.com


Hi,

Many thanks for your post. Can you please give me the complete implementation of code for me to use in my experiment. I am trying hard to get this fixed but am very poor in programming basically. I am a color science guy. Your code will be very helpful for me.

Bis

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us