Google Groups Home
Help | Sign in
Controlling the number of values in imwrite when outputing ASCII
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
ac  
View profile
 More options Apr 25, 8:21 pm
From: ac <achad...@tenesix.com>
Date: Fri, 25 Apr 2008 17:21:54 -0700 (PDT)
Local: Fri, Apr 25 2008 8:21 pm
Subject: Controlling the number of values in imwrite when outputing ASCII
Hi
I am trying to read a jpg file and write it out as ASCII text (so I
can use it to drive rtl). This is what my .m file contains.
***************************
clear;
rgb = imread('c:/testmathlab/flamingo.jpg');
imfinfo('C:/testmathlab/flamingo.jpg');
imshow(rgb);
imwrite(rgb,'c:/testmathlab/flamingo.ppm', 'Encoding','ASCII');
***********************************

I get the following in the .ppm file.

P3 2560 1920 255
46 51 28 33 38 16 21 24 3 16 19 2 17 17 5 20 17
10 23 20 15 28 20 18 32 23 24 30 20 21 27 17 16 25

Many lines like this and then the last 2 lines are like this

164 137 108 170 144 117 171 145 118 163 139 113 162 138 112 162 140
116 157 135 111

Wondering if
a) the values are listed as R,G,B..... or is it in some other order
b) I seem to get 17 values per line, how can I make it 16
c) The first line - what is P3; I can guess what the other things mean
but where is this documented. Could not find it easily enough.
d) is there another format I can use, I only need the ascii format so
I can see the values and drive a rtl module in modelsim

Thanks a lot for your help

ac


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google