Re: processing image in a specific region



"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 message
<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
use.
many of the matlab functions work on rgb images... just
not
roi2poly. so you can use roi2poly on ONE of the image
planes of your original (i.e. don't convert it to
grayscale,
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?

.



Relevant Pages

  • Re: processing image in a specific region
    ... (eg. adjust brightness) ... many of the matlab functions work on rgb images... ... just pick the red channel to use for ... then process the image under the mask. ...
    (comp.soft-sys.matlab)
  • Re: Scanner woes
    ... mask from a *single* bin i.e. extreme highlights! ... The only way I see histograms badly ... To bring the channels back into sync you have to *GUESS* where the ... By applying Analog Gain *selectively* you do more damage than good ...
    (comp.periphs.scanners)
  • Re: Magnetic Lasso alternative?
    ... the normal paint tools to define a mask. ... Edges should generally be partially transparent to ... keyword extract, as this command has moved around with various versions ... people have perfected techniques over the years involving using channels ...
    (alt.graphics.photoshop)
  • Re: interpolation for a color image?
    ... produce a result that is the same as box interpolation of RGB. ... interpolation errors on reparate RGB channels may produce a new pixel value slightly ... store the RGB ratios for each pixel, i.e., keep the original image, convert ...
    (sci.image.processing)
  • Re: Decent SCART Switch?
    ... >>> does this have optical on all channels? ... >> It does switch RGB and it even has a little switch for choosing between ... >> composite/RGB and then seeing the horridness of composite video reminds ... I bought a switcher from Play ...
    (uk.games.video.xbox)

Loading