matlab - Anyone explain me the working of this code -


This program shows the original image, scaled image, and crop image but how the code image is scaled I Can not understand code work and logic Can anyone here tell me how this code works? thank you in advanced.

  [row, cola] = size (take); Scale_Rows = 2 * line; Scale_Cols = 2 * cola; Scale_image = Zero (Scale_Rows, Scale_Cols); I for = 1: line for Jammu = 1: colonel scale_is (i * 2, j * 2) = take (i, j); End capacitance conv_mask = [0.25 0.5 0.25; 0.5 1 0.5; 0.25 0.5 0.25]; Fin_lane = take; the figure; Imshow (fin_lena); Title ('scaled image'); The code here starts by repeating the size of the image in the context of coordinates:    

,

So if the original image

  ABCD   

this Then it happens: <<> X is an empty pixel.

The code fills (interpolts) taking a combination of pixels around its surroundings with empty pixels:

  conv_mask = [0.25 0.5 0.25; 0.5 1 0.5; 0.25 0.5 0.25];   

So this means that for the pixel you currently weigh 1, 0.5 for any pixel that is immediately up or down and 0.25 for the nearest diagonal pixel. After doing this for all the pixels the gap is filled. In this way, by filling the gap, you end the original pixels with a better-looking picture than doubling.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -