我有一個 8 位影像('Example_image.tif'),我想使用來自 .csv 檔案('Pseudocolor_sheet.csv')的自定義 RGB 值來偽彩色。在 .csv 檔案中,行代表像素值 (0-255),而第 1、2、3 列分別代表相應的紅色、綠色和藍色強度。目前,該代碼會生成一個所有像素都顯示為白色的影像。我試圖弄清楚如何正確映射 RBG 值。謝謝!這是我到目前為止所擁有的:
clc;
clear;
close all;
[filename,filepath] = uigetfile({'C:\Users\'},'Select Example Image','*');
ExampleImage = imread(strcat(filepath, filename));
RGBImage = ind2rgb(ExampleImage,'pseudocolor_sheet.csv');
imshow(RGBImage);
uj5u.com熱心網友回復:
試著做:
cmap=csvread('pseudocolor_sheet.csv');
imshow(ExampleImage ,cmap);
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/475864.html
標籤:matlab
