Display Pixel Values in Image - Alternative to `showPixelValues()`

조회 수: 4 (최근 30일)
Royi Avital
Royi Avital 2017년 9월 3일
댓글: Image Analyst 2023년 8월 22일
Hello,
I would like to display an image and its pixel values in a similar manner to showPixelValues().
What I need is to be able to display it on an Axes Object on my own.
Namely something like:
hFigure = figure();
hAxes = axes();
DisplayImagePixelsValues(hAxes, mInputImage);
% Now set the properties of the axis.
Are there any alternatives to `showPixelValues()`? Something with more user control.
Thank You.
---
Update
According to answers it seems I wasn't clear.
I don't want to show data of a current axis or something.
I want a function which the input is a matrix (Small one) and the output is a regular axis object with result of an image with text of the pixels values.
From there I'd like to be able to customize this axes to my wishes.

답변 (3개)

Image Analyst
Image Analyst 2017년 9월 3일
How about impixelinfo()?
  댓글 수: 3
Image Analyst
Image Analyst 2017년 9월 3일
If not, then you'll just have to use text() to put up text labels over the image pixels.
Royi Avital
Royi Avital 2017년 9월 4일
Hi, I looked into that. But I'd prefer having something which displays in a Figure Object (For exporting purposes). Has anyone implemented something like showPixelValues() in low level?

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2017년 9월 3일
The existing File Exchange contribution you linked to, does an imshow() without any parent, so it will display inside the current axes.
However, I discovered recently that if you imshow() and the current axes is at the default position, that imshow sets up conditions so that the axes will typically be deleted on the next graphics operation. You can avoid that by setting a non-default Position for the axes.
In any case you can easily edit the File Exchange Contribution to add a 'Parent' property to the imshow() calls and other calls.
  댓글 수: 9
Walter Roberson
Walter Roberson 2017년 9월 6일
What HTML code? The routine you linked to does not create HTML. Which routine are you looking at that produces HTML?

댓글을 달려면 로그인하십시오.


Sindhu
Sindhu 2023년 8월 22일
I need to display the pixel value in satellite image?
  댓글 수: 1
Image Analyst
Image Analyst 2023년 8월 22일
Display how?
help impixelinfo
IMPIXELINFO Pixel Information tool. IMPIXELINFO creates a pixel information tool in the current figure. The pixel information tool displays information about the pixel in an image that the cursor is positioned over. The tool can display pixel information for all the images in a figure. The pixel information tool is a uipanel object, positioned in the lower-left corner of the figure, that contains the text string "Pixel Info" followed by the pixel information. The information displayed depends on the image type, as shown below. If the cursor is outside of the image area in the figure, the pixel information tool displays the default string. Image Type Default String Example ---------- -------------- ----------------- Intensity (X,Y) Intensity (13,30) 82 Indexed (X,Y) <index> [R G B] (2,6) <4> [0.29 0.05 0.32] Binary (X,Y) BW (12,1) 0 Truecolor (X,Y) [R G B] (19,10) [15 255 10] If you want to display pixel information without the "Pixel Info" label, use IMPIXELINFOVAL. IMPIXELINFO(H) creates a pixel information tool in the figure specified by the handle H, where H is an image, axes, uipanel, or figure object. Axes, uipanel, or figure objects must contain at least one image object. IMPIXELINFO(HPARENT,HIMAGE) creates a pixel information tool in HPARENT that provides information about the pixels in HIMAGE. HIMAGE is a handle to an image or an array of image handles. HPARENT is a handle to the figure or uipanel object that contains the pixel information tool. HPANEL = IMPIXELINFO(...) returns a handle to the pixel information tool uipanel. Note ---- To copy the pixel information string to the clipboard, right-click while the cursor is positioned over a pixel. In the context menu, choose Copy pixel info. For a floating point image with the 'CDataMapping' property set to 'direct', the pixel information tool displays this default string: (X,Y) value <index> [R G B] Examples -------- h = imshow('hestain.png'); hp = impixelinfo; set(hp,'Position',[5 1 300 20]); figure subplot(1,2,1), imshow('liftingbody.png'); subplot(1,2,2), imshow('autumn.tif'); impixelinfo See also IMPIXELINFOVAL, IMTOOL. Documentation for impixelinfo doc impixelinfo

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by