Display rgb image in cartesian plane

5 ビュー (過去 30 日間)
marie lasz
marie lasz 2020 年 10 月 14 日
コメント済み: Bjorn Gustavsson 2020 年 10 月 15 日
hello,
Can we display transformed image in cartesian plane according to image's rotation or shear? iF yes, then how can we do this?(I want to display a rgb image not its color pixels )
Any help would be appreciated.

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2020 年 10 月 14 日
Previously I've used: tcolor, with good results.
HTH
  3 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2020 年 10 月 15 日
Possibly, I've used them interchangeably in this context.
marie lasz
marie lasz 2020 年 10 月 15 日
thanks :-)

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

その他の回答 (2 件)

Image Analyst
Image Analyst 2020 年 10 月 14 日
Did you try view() -- I think that will do what you want.
Or else try Steve's blog:
or else do something like this:
% Takes an RGB image and stacks the separate color channels at different Z levels.
imtool close all; % Close all imtool figures if you have the Image Processing Toolbox.
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 13;
filename = 'peppers.png';
rgbImage = imread(filename);
% Extract the individual red, green, and blue color channels.
redChannel = im2double(rgbImage(:, :, 1));
greenChannel = im2double(rgbImage(:, :, 2));
blueChannel = im2double(rgbImage(:, :, 3));
H(1) = slice(repmat(redChannel,[1 1 2]),[],[], 1); %slice() requires at least 2x2x2
set(H(1),'EdgeColor','none') %required so image isn't just an edge
hold on
H(2) = slice(repmat(greenChannel,[1 1 2]),[],[], 2); %slice() requires at least 2x2x2
set(H(2),'EdgeColor','none') %required so image isn't just an edge
H(3) = slice(repmat(blueChannel,[1 1 3]),[],[], 3); %slice() requires at least 2x2x2
set(H(3),'EdgeColor','none') %required so image isn't just an edge
hold off
colormap(gray(256))
axis ij
caption = sprintf('R, G, and B Color Channels of %s', filename);
title(caption, 'FontSize', fontSize);
% Put up legend that says what slice is what color channel.
legend('B', 'G', 'R')
  4 件のコメント
marie lasz
marie lasz 2020 年 10 月 15 日
I used that but why the image is flipping ?
Bjorn Gustavsson
Bjorn Gustavsson 2020 年 10 月 15 日
That is just a convention-confusion, tcolor uses the same convention that pcolor uses, displayin the matrix-element M(1,1) in the lower-left-corner, and matrix-element M(N1,1) in the upper-left-corner, while image, imagesc and imshow display the matrices with M(1,1) in the upper-left-corner and M(N1,1) in the lower-left-corner. This you can change by either a simple: axis ij or flipping the image with flipdim, or flipping the dimensions on your x and y coordinate matrices. Or this is perhaps the "geographic" orientation your image should have if you've determined the x and y coordinates of your pixels.
HTH

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


Image Analyst
Image Analyst 2020 年 10 月 15 日
You can simply open the properties window of the axes and set the viewing property to manual, and then use the tools above the axes to tilt and spin your image around. Then you can use the "File->Generate Code" pulldown menu of the figure to generate the code if you want to do that all the time instead of interactively each time. Here is a screenshot:
  1 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2020 年 10 月 15 日
Since the OP showed an example with multiple skew-transformed versions of an image it seems to be more on-target to use tcolor since that is a pcolor-modification with RGB-handling abilities.

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

カテゴリ

Help Center および File ExchangeExplore and Edit Images with Image Viewer App についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by