Re: [問題] 有關三維影像顯示問題已回收
嘗試寫了一下,看是否有幫助
% Keywords: reshape, imshow, uint8.
% The cross section image is grabed from 3D image.
clear all
close all
clc
% control variable
size = 100;
depth = 30;
% The 3D image under inspection is created by arithmetic sequence.
img1(:, : ,1) = ones(size,size, 1);
for i = 2:depth
img1(:, : ,i) = 5 * ones(size,size, 1) + img1(:, :, i-1);
end
% The cross section image is obtained form matrix operation.
% The shape of matrix is (x, 1, y), which can't reveal via imshow().
img2 = img1(:, 2, :);
% The matrix is reshaped in (x, y, 1) format, and convet to uint8
% format, then reveals via imshow().
img3 = reshape(img2, size, depth, 1)
imshow(uint8(img3),[])
※ 引述《hotun (空空如也~~)》之銘言:
: 請問一下我有一組立體的影像
: 假設 a=(256,256,52);
: 意思是我有 52 張 256*256 pixels 的影像
: 我顯示第一張我可以用 image(a(:,:,1)); 沒問題
: 但今天我想看另一個切面的影像
: 假設我今天存了另一個陣列 b=(128,:,:);
: 所以 b 的陣列顯示是 b= 1*256*52;
: 問題來了~~
: 這個矩陣中我要看的其實是 a 影像中另一個切面影像
: 但是要顯示 b 影像的時候無法顯示
: 因為 b 是一個 1*256*52 的陣列
: 等於是說 b 為一個 52張 1*256 pixels 的影像
: 我想問說在b 的矩陣中可不可以將它轉成 b = 256*52*1 ???
: 這樣才可以顯示出這一個影像
: 有這個指令嗎??
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.4.235
※ 編輯: PHANTOMAN 來自: 140.112.4.235 (06/29 11:07)
推
06/30 01:20, , 1F
06/30 01:20, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章