High-resolution images and single pixels visualization

5 views (last 30 days)
Hello,
i'm experiencing some difficulties in visualizing an image matrix, where i'm trying to control single pixels. It seems that for high resolution screens/images, such as 3840x2160 or 2560x1440 it is not possible to turn on a single pixel on the target display.
I perform the following steps:
  • a matrix of zeros is created (for example a 3840x2160 matrix);
  • some cells are set to 1 or another value (let's consider a greyscale image);
  • a figure with the axes dimension set to 3840x2160 is created on a 4k screen
  • the image is visualized
It seems that either a 2 or 4 pixels can be turned on, but not a single one. I arleady tried to use smaller resolutions and changing the dimension of the figure and axes. It's seems there is no such a problem for 1920x1080 images on HD displays.
Thank you.
  3 Comments
Anton Bahu
Anton Bahu on 17 Jun 2022
Edited: Anton Bahu on 17 Jun 2022
Right, my goal is to create a matrix n times m , where n and m are targer display resoltuion. My elements range from 0 to 1 and represents the greyscale intensity of one pixel.
For high-resolution displays, whatever I try to do, it's seems impossible to light just one single pixel. Even if i consider a smaller matrix (let's say 1200x1500), and set the axes dimensions exactly to be 1200x1500, either no or 2/4 pixels are shown on the screen:
image = zeros ([1200,1500]);
image(601,701)=1;
figure('Name','Image in FoV','MenuBar', 'none', ...
'ToolBar', 'none');
hAxis = axes;
hFigure=imshow(ones([1200 1500]),'Parent',hAxis);
set(gcf,'unit','pixel','position',[0 0 1300 1600]);
set(gca,'unit','pixel','position',[0 0 1200 1500])
set(hFigure,'CData',image);
Note that for smaller matrixes (less than 1000x1000) i do no experience any troubels.
Thank you

Sign in to comment.

Answers (2)

Anton Bahu
Anton Bahu on 30 Jun 2022
Hi, tech support solved my problem
THe issue is is due to the default setting of the maximum texture size of the image created by "imshow". This property controls the finest scale at which an image is shown on the screen. For high-resolution images, this may cause pixel-level details to be smoothed out, thus causing multiple pixels to light up when only one should be.
To avoid this issue, it's set the maximum texture size to a value that is larger than the size of the image in both dimensions by changing the value of "MaxTextureSize", which is a property of the image created by "imshow":
image = zeros([1000, 2500]);
image(500, 500) = 1;
figure('Name', 'Image in FoV', 'MenuBar', 'none', 'ToolBar', 'none');
hAxis = axes;
hFigure = imshow(image, 'Parent', hAxis);
hFigure.MaxTextureSize = 3000;
MaxTextureSize, set to 3000, have to be larger than both the length and width of the image. With this line.
Good luck to all!

Image Analyst
Image Analyst on 17 Jun 2022
Even though you should have enough resolution to display pixel for pixel that image with that large display, I wonder if you can't sometimes see a single pixel because of some sort of scaling that goes on. Can you try to experiment with the truesize function?
  2 Comments
Anton Bahu
Anton Bahu on 20 Jun 2022
Hello Image Analyst, thank you for the answer. I waited to have the hardware under hands before replying, so to provide you reliable information.
Truesize works fine until my matrix side becomes bigger than 2000 pixels. So even on a 4K screen, if the image is small, I have correpsondence, but as soon as the image becomes bigger either 2 or 4 pixels are turned on. This is probably due to scaling, but somehow it does not influence images until these becomes big enough. Once the test image is set to be large enough, all the commands i try fails to provide reliable image.

Sign in to comment.

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!