Hi, i am trying to modify an image based on the histogram
of the pixel grayscale values in the unmodified image. i
can do the modification itself using imshow(image, [low
high]), however i cannot save this information as a new
seperate image/variable...any thoughts? sorry if this is
basic but i am a beginner....
-Ben
When I do this type of routine I use the find function in
matlab and search for areas below and above the "low" and
'high" values I'm interested in. Then you can set the
selected range to be black.
ex:
selected = find(image<low);
image(selected)=0;
-Jason
"ben " <badler10@yahoo.com> wrote in message
<fjjlpv$ed7$1@fred.mathworks.com>...
> Hi, i am trying to modify an image based on the histogram
> of the pixel grayscale values in the unmodified image. i
> can do the modification itself using imshow(image, [low
> high]), however i cannot save this information as a new
> seperate image/variable...any thoughts? sorry if this is
> basic but i am a beginner....
> -Ben
Ok, i am not yet trying to turn the image into b/w. what i
am looking to do is to save the image i have "windowed"
with imshow so that i can do other manipulations or
calculations to it. For example, i am looking at CT scans.
You see different tissues having different intensities and
with the histogram and imshow you can sort of isolate the
different tissues. Then to get the area of a specific
feature I would like to subtract the images i have produced
from each other...only thing is i cant figure out how to do
this without making it a new variable, which is my
problem...thanks though!
-ben
"Jason Brown" <jeb8828@rit.edu> wrote in message <fjjmp6
$sgd$1@fred.mathworks.com>...
> Ben,
>
> When I do this type of routine I use the find function in
> matlab and search for areas below and above the "low" and
> 'high" values I'm interested in. Then you can set the
> selected range to be black.
>
> ex:
>
> selected = find(image<low);
> image(selected)=0;
>
> -Jason
>
> "ben " <badler10@yahoo.com> wrote in message
> <fjjlpv$ed7$1@fred.mathworks.com>...
> > Hi, i am trying to modify an image based on the
histogram
> > of the pixel grayscale values in the unmodified image.
i
> > can do the modification itself using imshow(image, [low
> > high]), however i cannot save this information as a new
> > seperate image/variable...any thoughts? sorry if this
is
> > basic but i am a beginner....
> > -Ben
>
Thanks for the feedback...i may have missed something in
your code, as it spit back my original image. I will keep
working on it. In the meantime though i found a better
solution for my problem, which allows me to threshold at
the same time. I can get the image i am looking for using
im2bw(image, level), where the level is of course the
threshold based on the histogram. You need to be able to
convert your colorscale to the appropriate threshold, but
that is not difficult (in the case of grayscale simply
divide your level by 255) and that way users only need to
input one number. thanks again for the help!
-ben
"jason " <mcmains.1@osu.edu> wrote in message
<fjk4in$iim$1@fred.mathworks.com>...
> if you have the image in a figure you could do the
> following:
>
> fig1=figure;
> imshow(image,[low high]);
> ax1=gca;
> newimage=get(get(ax1,'children'),'cdata');
> that should extract the current image from the figure
>
> HTH
> Jason
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Disclaimer prior to use.