Re: processing image in a specific region
- From: "Bryan " <cssmwbs@xxxxxxxxx>
- Date: Fri, 4 Apr 2008 18:10:20 +0000 (UTC)
"Kristie " <kristieyin@xxxxxxxxx> wrote in message
<ft4b7i$m4q$1@xxxxxxxxxxxxxxxxxx>...
"Bryan " <cssmwbs@xxxxxxxxx> wrote in message
<ft07if$3qf$1@xxxxxxxxxxxxxxxxxx>...
"Kristie " <kristieyin@xxxxxxxxx> wrote in messageuse.
<ft04oe$dpg$1@xxxxxxxxxxxxxxxxxx>...
Then is it NOT possible for me to apply some functions
(eg. adjust brightness) of a certain region of a COLOR
image?
thanks very much!
sure it is, it just depends on the function you want to
many of the matlab functions work on rgb images... justnot
roi2poly. so you can use roi2poly on ONE of the imagegrayscale,
planes of your original (i.e. don't convert it to
just pick the red (or green or blue) channel to use for
roipoly, and then once you have the mask, you can use it
along with the adjustment functions on your original rgb
image. this would generally look something like this:
img = imread('yourImageFile.jpg');
imgMask = roipoly(img(:,:,1)); %this uses the red channel
then process the image under the mask. if necessary, you
can loop through the channels (the third dimension in a
matlab rgb image).
bryan
Hi, I finally can combine the separate color into one
image after I mask them.
However, after the final recombined image goes out, I
notice the selected part of the image becomes blank (in
white color. I don't know what is the problem.
The code is as follows,
I=imread('s6.jpg');
img=rgb2ntsc(I);
mask = roipoly(img(:,:,1));
first of all, i do not think you should be operating in ntsc
space. if you want to do something out of rgb, i would
suggest instead that you convert to hsv, and then maybe do
your filtering on one of those channels (perhaps the
intensity or/and saturation channels).
img_new=img;
img_new(:,:,1)=img_new(:,:,1) + 0.5;
J = roifilt2(img_new(:,:,1),img(:,:,1),mask);
are you just trying to add a value of .5 to the pixels in
your mask? i don't understand what you're doing in
filtering the red channel of your modified image using the
red channel of your initial image (which is what is being
done in the way you have called roifilt2).
can you explain, in words, what you were hoping would happen
in this example?
.
- Follow-Ups:
- Re: processing image in a specific region
- From: Kristie
- Re: processing image in a specific region
- References:
- processing image in a specific region
- From: Kristie
- Re: processing image in a specific region
- From: Bryan
- Re: processing image in a specific region
- From: Kristie
- Re: processing image in a specific region
- From: Walter Roberson
- Re: processing image in a specific region
- From: Kristie
- Re: processing image in a specific region
- From: Dave Robinson
- Re: processing image in a specific region
- From: Kristie
- Re: processing image in a specific region
- From: Bryan
- Re: processing image in a specific region
- From: Kristie
- processing image in a specific region
- Prev by Date: Re: File exchange
- Next by Date: Re: save workspace in v7.3 format
- Previous by thread: Re: processing image in a specific region
- Next by thread: Re: processing image in a specific region
- Index(es):
Relevant Pages
|
Loading