Computer Science, asked by archanachougale6425, 8 months ago

What is the function of pixel rounding.

Answers

Answered by manishpatel02
43

Explanation:

I'm looking to take in an image of 162x193 pixels and basically scale it down by 0.125 i.e 162/8 = 20.25 and 193/8 = 24.125. Thus I would like a picture of size 20x24 The only problem I'm currently having is that when I use the imresize function it rounds up the images pixel values i.e I get an image of size 21x25 instead of 20x24. Any way of getting 20x24 or is this problem something I'm going to have to live with? Here is some code:

//Read in original Image

imageBig = imread(strcat('train/',files(i).name));

//Resize the image

image = imresize(imageBig,0.125);

disp(size(image));

Similar questions