Hi i have a binary image in the file format .pbm its a 640x480 image and i want to compress the image to 32x32 How to do i do it?

댓글 수: 3

Walter Roberson
Walter Roberson 2015년 8월 11일
Is the 32 x 32 binary or could it be uint8() or could it be double() ?
You would not typically be able to preserve all of the information of a 640 x 480 binary image in a 32 x 32 array: if the 32 x 32 is to be binary it would require a compression rate of 300:1 which is not common at all for lossless compression. You should expect to be using compression that loses information. What kind of information about the image is it acceptable to lose?
To check: the 32 x 32 is to be data, right? Not an image itself? Data that could be used to reconstruct a 640 x 480 image? Because if the 32 x 32 is to be an image, that would be image resizing, not image compression.
When you say that you want 32 x 32: are you trying to construct feature vectors out of the 640 x 480?
Newman
Newman 2015년 8월 11일
@walter roberson Hi yes they have to be binary only as i need to apply ANN on them but i need to resize/compress them to 32x32 without any significant loss of data.I want to train them to recognise a human being.I am attaching the binary image.
Walter Roberson
Walter Roberson 2015년 8월 14일
For pattern recognition you should be creating feature vectors rather than submitting the scaled-down image directly.

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

 채택된 답변

Image Analyst
Image Analyst 2015년 8월 11일

0 개 추천

Try imresize() function in the Image Processing Toolbox:
smallImage = imresize(binaryImage, [32, 32], 'Nearest');
Obviously you will have loss of data. Not sure how you define "significant". I guess if your algorithm can still recognize what's in the scene, despite being smaller, then it's not significant.

댓글 수: 2

Newman
Newman 2015년 8월 11일
can this be done with the help of PCA(principal component analysis)? i was going through this link but couldnt understand what has been written http://stackoverflow.com/questions/31884985/what-does-selecting-the-largest-eigenvalues-and-eigenvectors-in-the-covariance-m/31885685#31885685
Image Analyst
Image Analyst 2015년 8월 14일
That would get the main axis going through the body.
I don't know much about this field, but there is a whole field of image processing involved in looking at silhouettes of human bodies or body parts. Go here to VisionBib to find all the papers on it.

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

추가 답변 (0개)

질문:

2015년 8월 11일

댓글:

2015년 8월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by