How to add zeros by comparing the file sizes of the two images?
Suppose the first image is 240x152 and the second image is 240x168
And i need to resize the first image using zeros to the same as the bigger one that is 240x168
so how is it possible to do the same?

답변 (2개)

Himanshu tripathi
Himanshu tripathi 2019년 6월 28일

1 개 추천

Try this
I = rand(240,152) ; // first image
iwant = zeros(240,168) ;
iwant(1:240,1:152) = I ;

댓글 수: 3

Pravita Lekshmanan
Pravita Lekshmanan 2019년 6월 28일
i need to add zeros at the beginning of the first image to compensate with the second image
Could you please let me know how to do that
Are you looking for this?
zero_matrix = zeros(240,168-152);
I = [zero_matrix,I]
Pravita Lekshmanan
Pravita Lekshmanan 2019년 6월 28일
Yes exactly i was looking for the above answer and it worked well
Thankyou so much

댓글을 달려면 로그인하십시오.

AISWARYA SUBRAMANIAN
AISWARYA SUBRAMANIAN 2019년 6월 28일
편집: AISWARYA SUBRAMANIAN 2019년 6월 28일

0 개 추천

I would suggest you to look through the following link:

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2018b

태그

질문:

2019년 6월 28일

댓글:

2019년 6월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by