网、强度图像,3 d

8视图(30天)
琼
2013年6月29日
你好,我是做进口的一些图像处理的一个视频剪辑并提取相关的框架。我想带一个图像(强度值)和使用网()或类似的函数创建一个3 d图,x和y是像素的位置和z轴的强度或像素值。当我使用网格()函数,我只是得到一个空白的3 d图,“警告:矩阵维度必须同意,不呈现网状。“我做错了什么?任何帮助吗?光谱强度需要调整吗?我怎么使矩阵维度“同意”?非常感谢任何帮助。
2的评论
琼
2013年6月30日
%创建工作目录和名称workingDir = tempname;mkdir (workingDir);mkdir (workingDir '图像');vids1 = VideoReader (“trimmedshort1_4.mov”);%选择帧,提取、转换为强度二= 1000:1005 img1 =阅读(vids1, ii);hcsc = vision.ColorSpaceConverter;hcsc。转换=“RGB强度”;I_I1 =步骤(hcsc img1);I_I2 = imcomplement (I_I1); %adjust intensity J1 = imadjust(I_I2,[],[],100);
imwrite (j - 1, fullfile (workingDir‘图片’,sprintf (img % d.jpg, ii)));结束%到适当的顺序排序imageNames = dir (fullfile (workingDir,‘图片’,‘* . jpg”));imageNames = {imageNames.name} ';(imageNames imageStrings = regexp ({}):,“(\ d *)”,“比赛”);imageNumbers = str2double (imageStrings); [~, sortedIndices] =排序(imageNumbers);sortedImageNames = imageNames (sortedIndices);disp (sortedImageNames) %编写视频文件outputVideo = VideoWriter (“vidout.avi”);outputVideo。帧速率= vids1.FrameRate;打开(outputVideo); for iii = 1:length(sortedImageNames) img = imread(fullfile(workingDir,'images',sortedImageNames{iii})); writeVideo(outputVideo,J1); end
这是原始的脚本(上图),我使用生成图像。然后,我做这样的尝试的空间/强度3 d图的图像帧:
img = imread (fullfile (workingDir‘图片’,sortedImageNames {1}));imshow (img)网(双(img)有点纤细而无益的,如果来自一个灰度图像强度(我希望导致colormap飞机)我能做冲浪(双(img)产生一个曲面图在黑色,或meshgrid (img)运行永远和冻结我的电脑。任何建议吗?多谢。

登录置评。

接受的答案

沃尔特·罗伯森
沃尔特·罗伯森 2013年6月29日
你构建你的x和y坐标使用meshgrid () ?如果你是使用ndgrid ()。
(x, y) = ndgrid (. .);
网格(x, y, z)
1评论
琼
2013年6月30日
嘿,伙计们,谢谢你,我最终得到它;必须使用网格(双(…))。我也会试试这个评估选择。我还有一个问题是三维空间和强度图只显示在colormap飞机如果形象已经映射。否则,我得到一个相似的情节,但是只有黑色所有z(一个大黑blob)水平。我将我的代码在回答沃尔特。再次感谢!

登录置评。

更多的答案(0)

类别

找到更多的在照明、透明度和阴影帮助中心文件交换

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!