필터 지우기
필터 지우기

how to convert image of size < 256*256unit8> into size<256*256double> on matlab

조회 수: 1 (최근 30일)
i have two image(suppose a and b) of size 256*256unit8 and of size 256*256double. and i want to modulate both image so how to do? modulation means a.*b but due to different size a.*b gives an error, so how to make same size of both images?

채택된 답변

Jan
Jan 2017년 3월 22일
편집: Jan 2017년 3월 22일
But both images have the same size, only the type differs. If you get an error, it would be useful if you post the complete message and the line of code, which produces the error.
The double array might have values between 0.0 and 1.0, while the uint8 image contains values in the range of 0 to 255. For the result this might be important. So perhaps you want:
a = randi([0, 255], 256, 256, 'uint8');
b = rand(256, 256);
c = double(a)/255 .* b;

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by