current position:Home>The assignment cannot be performed because the size on the left is 400 × 1200, 400 on the right × four hundred × 3。

The assignment cannot be performed because the size on the left is 400 × 1200, 400 on the right × four hundred × 3。

2022-02-04 16:33:56 CSDN Q & A

img

img

Why are they all the same size , But you can't assign a value , All are 4001200, Why is the one on the right divided into 400400*3




Take the answer :

Hello ,T2 The data is from imread From China ,imread The return is m×n×3 The data of , It's actually three-dimensional data , The first and second dimensions represent the height and width of the picture , The third dimension represents RGB Three colors .
So the suggestion is to follow RGB To generate :

[m,n,p]=size(t);%p=3 Namely RGB Three channels T2 = t;T5 = double(T2);t2 = zeros(m+4,n+4,p);t2 = double(t2);% This sentence can actually be deleted , because zeros Generated t2 Namely double type t2(3:m+2,3:n+2,:) = T5;% That's it 

If it's helpful, please give an answer and support the answer , Thank you first


copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/02/202202041633538353.html

Random recommended