Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I have a pattern recognition problem in which I am trying to convert a PRdatafile containing set of images as its objects, into individual image files. Anybody that knows how to do that?

1 vue (au cours des 30 derniers jours)
Gaurav
Gaurav le 28 Nov 2013
Clôturé : MATLAB Answer Bot le 20 Août 2021
this is a part of my code:
a = prnist([0:9],[1]); % Taking the NIST dataset and displaying 10 digits obj = a(1); % Taking first object of the dataset
Now how do I convert this object( which is an image) into an image file. I have to perform certain image processing operations on this image file.
Thanks!

Réponses (1)

Image Analyst
Image Analyst le 28 Nov 2013
If (the badly-named) a is an image array, you can create a file by creating a filename string and then using imwrite:
imwrite(a, fullFileName);
  2 commentaires
Gaurav
Gaurav le 28 Nov 2013
Thanks, but imwrite function does not work with prdatafiles. I have tried using it.
Image Analyst
Image Analyst le 28 Nov 2013
Sorry - a was your dataset. Use obj, the image that you pulled out of the data set. I didn't notice it because you didn't properly format your code like this shows you: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup. So, now assuming obj is the image, as you seemed to say:
imwrite(obj, fullFileName);

Community Treasure Hunt

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

Start Hunting!

Translated by