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?

Réponses (2)

Himanshu tripathi
Himanshu tripathi le 28 Juin 2019

1 vote

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

3 commentaires

Pravita Lekshmanan
Pravita Lekshmanan le 28 Juin 2019
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 le 28 Juin 2019
Yes exactly i was looking for the above answer and it worked well
Thankyou so much

Connectez-vous pour commenter.

AISWARYA SUBRAMANIAN
AISWARYA SUBRAMANIAN le 28 Juin 2019
Modifié(e) : AISWARYA SUBRAMANIAN le 28 Juin 2019

0 votes

I would suggest you to look through the following link:

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Produits

Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by