how to convert a tif image to a m-by-n-by-3 array

13 Ansichten (letzte 30 Tage)
Arlete Conde
Arlete Conde am 22 Jul. 2022
Kommentiert: Walter Roberson am 22 Jul. 2022
Hi. How can I a convert a tif image to a m-by-n-by-3 array? I am trying to use the code of boxcount but I am having problems because my image is in the format, being that the code is for m-by-n or m-by-n-by-3 array.
  8 Kommentare
Arlete Conde
Arlete Conde am 22 Jul. 2022
@Walter Roberson I used the code:
A = imread('B2.tif');
imshow(A)
RGB = repmat(A, 1, 1, 3);
I got a table: RGB = 5375×6421×3 double. How can I change this to a image?
Walter Roberson
Walter Roberson am 22 Jul. 2022
A = imread('B2.tif');
RGB = repmat(A, 1, 1, 3);
imshow(RGB)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Chunru
Chunru am 22 Jul. 2022
[a, cmap] = imread("corn.tif");
subplot(121); imshow(a, cmap);
b = ind2rgb(a, cmap);
subplot(122); imshow(b);
whos b
Name Size Bytes Class Attributes b 415x312x3 3107520 double
  3 Kommentare
Chunru
Chunru am 22 Jul. 2022
Can you attach your image? Or at least show the result of: size(a)
Arlete Conde
Arlete Conde am 22 Jul. 2022
@Chunru this is the size of a=375×6421 double

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by