Resizing pixels with independent scaling factor?
Afficher commentaires plus anciens
How can be pixels resized with independent scaling factor?
Keeping size of final image same as initial image.
e.g.
+
= 
Resizing method 'nearest' would be enough.
Right I am using some kind of 'for' loop but want to avoid it for faster processing.
Starting experiment data could be:
%% Creation of starting image
w=8;
im=255*ones(w,w,1, 'uint8');
im(2,2,:)=0;
im(6,6,:)=0;
%% Inputs to resize pixels
row=[2;6]; col=[2;6];
scale=[3;5]; % length of each of these inputs are same, explanation: pixel{2,2} will have a scaling factor 3 and so on..
% fractional scaling factor can be entertained as per nearest resizing method.
% length of these inputs are large, of the order of number of pixels in the image, thats why for loop takes time.
Any innovative ideas are welcome
Note: During resizing process sometimes pixels may overlap, in this case, new values will overwrite the old values
i.e., pixels processed due to bottom values of [row, col & scale] can overwrite the previous values.
Thanks
3 commentaires
KALYAN ACHARJYA
le 15 Fév 2019
Resizing pixels or Resizing pixels numbers?
Keeping size of final image same as initial image.
Can you elaborate, how you calculate the size of an image?
JAI PRAKASH
le 15 Fév 2019
Jan
le 15 Fév 2019
@JAI: Please post the current working code, if you want us to improve it. Maybe the loop is the most efficient method, when it is optimized.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Communications Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


