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 CenterFile Exchange에서 Explore 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