How can i make vector lengths the same?
4 ビュー (過去 30 日間)
古いコメントを表示
%%read normal image first
im = imread('thing.jpeg');
subplot(311);
imshow(im);
title('Normal Image');
%%read infrared image
im1 = imread('thing_infrared.jpeg');
subplot(312);
imshow(im1);
title('Infrared Image');
%%convert normal inamge to gray scale
b = rgb2gray(im);
b = double(b);
%%covnert infrared image to gray scale
c = rgb2gray(im1);
c = double(c);
%%reading pixels for normal image
b1 = imshow(b);
impixelinfo(b1);
vector = reshape(b, [1600*1200 1]);
%%reading pixels for infrared image
c1 = imshow(c);
impixelinfo(c1);
vector1 = reshape(c, [1280*960 1]);
%%before plotting you need to make the vectors of the same length
%%plot(vector_lower(1:minlen) + vector1_lower(1:minlen), y);
%%maxlen = max(length(vector_lower), length(vector1_lower));
%%plot(vector_lower(1:maxlen) + vector1_lower(1:maxlen));
I have found this maxlen and minlen functions, but they aren t working. Should it be something to do with 255? Like divide somewhere to get 255 pixels?
Thank you
2 件のコメント
KSSV
2020 年 11 月 26 日
To make vectors lengths same, have a look on interp1. You can do interpolation.
採用された回答
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!