フィルターのクリア

colorbar not matching disparity image values

2 ビュー (過去 30 日間)
Ozan Anli
Ozan Anli 2022 年 6 月 23 日
編集済み: Yash 2023 年 10 月 25 日
I calculated a disparity image. Plotting this image, i use the following basic code:
figure
imshow(dispa)
title('Disparity Map1')
colormap jet
colorbar
The disparity image is a variable of type 478x638 double.
The result of the given plotting code shows me a colorbar, which does not match the colorbar:
I displayed an example DataTip. The 'value' of this pixel ist 38.5105. The colorbar is still going from 0 to 1.
If i extend the colorbar range, the colorbar becomes nearly completely red:
How can i display the disparity image with a suitable colorbar next to the disparity image?
  1 件のコメント
Jonas
Jonas 2022 年 6 月 23 日
did you try imagesc() instead of imshow()?

サインインしてコメントする。

回答 (1 件)

Yash
Yash 2023 年 10 月 25 日
編集済み: Yash 2023 年 10 月 25 日
Hi Ozan,
I understand that you are facing issues while plotting a disparity image using the "imshow" function.
According to the documentation (https://www.mathworks.com/help/images/ref/imshow.html), the function "imshow" uses the default display range for the image data type and optimizes figure, axes, and image object properties for image display. In this case, the default range is set from 0 to 1.
To address this issue, you can modify the default display range by providing the "DisplayRange" argument to the "imshow" function. For more information on how to use this argument, you can refer to the documentation at the following link: https://www.mathworks.com/help/images/ref/imshow.html#bvmnrxi-1-DisplayRange
You can modify the code to set the display range as shown below:
figure
imshow(dispa,[0 max(dispa)])
title('Disparity Map1')
colormap jet
colorbar
Alternatively, you can use the "imagesc" function to plot the image. The "imagesc" function displays the data in an array as an image, utilizing the full range of colors in the colormap. You can find more details about the "imagesc" function in the MATLAB documentation at the following link: https://www.mathworks.com/help/matlab/ref/imagesc.html
I hope this resolves the issue faced by you.

カテゴリ

Help Center および File ExchangeBlue についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by