Re: How to put pixels and RGB in m-file??



Dave Robinson wrote:
>
>
> sid wrote:
>>
>>
>> Hello..
>> HELP!! Can anyone help me to write the m-file for the pixels
and
>> RGB.
>> I used imtool and it gives the pixels and RGB of the image
(using
>> pixel region) . I need to make a argument, eg: if RGB bigger
then
>> 10
>> at specific pixel it will transmit a 1 and vice-versa.
>> at the image tool it is shown at the bottom:
>> Pixel info:(102,6) [224 224 224]
>>
>> how do i put this as an m-file? and want to make an argument as
>> said
>> above..
>>
>> thank you very much
>
> Totally confused as to what you are wanting here. However I guess
> what you are saying is that you have a colour image with RGB
> planes.
> You want to find pixels within the colour image whose value is
> above
> a given threshold on all three planes. If so something like the
> following might do the trick.
>
> % Define threshold
> Tau = mythreshold_value;
> %
> % Extract colour planes
> Red = MyImage(:,:,1);
> Green = MyImage(:,:,2);
> Blue = MyImage(:,:,3);
> %
> % Find pixels in individual planes which exceed threshold
> Red_Binary = im2bw(Red,Tau);
> Green_Binary = im2bw(Green,Tau);
> Blue_Binary = im2bw(Blue,Tau);
> %
> % Combine images using .AND. function to find pixels in which all
> exceed threshold
> Output = and(Red_Binary,and(Green_Binary,Blue_Binary);
>
> mythreshold_value is obviously a number which is your selected
> threshold level. MyImage is your RGB image.
>
> If that isn't what you are after I suggest you try rephrasing your
> question.
>
> Regards
>
> Dave Robinson

Hello... thanks for the reply. i forgot to mention that the picture
is taken from real-time video and saved straight away. when I tried
to run your programme it says:

??? Index exceeds matrix dimensions.

Error in ==> cuba1a at 21
Green =w(:,:,2);

what does that mean? I will try to rephrase what is needed. when I
run imtool, it will produce the image that is recorded. at the bottom
of it it gives:

Pixel info : (x,y) [R G B]

I would like to make a programme that at a specific x and y , if the
total RGB is above a certain value it will trigger an interupt. plz
help... thanks
.



Relevant Pages

  • Re: How to put pixels and RGB in m-file??
    ... If you want the user to mouse over the image and have a M-function tell you a new pixel value based on whether the "total" RGB value is over a particular threshold, ... I used imtool and it gives the pixels and RGB of the image ... You want to find pixels within the colour image whose value is above a given threshold on all three planes. ...
    (comp.soft-sys.matlab)
  • Re: How to put pixels and RGB in m-file??
    ... > particular threshold, then try the following. ... >>>what you are saying is that you have a colour image with RGB ... >>>You want to find pixels within the colour image whose value ... >> total RGB is above a certain value it will trigger an interupt. ...
    (comp.soft-sys.matlab)
  • Re: How to put pixels and RGB in m-file??
    ... > I used imtool and it gives the pixels and RGB of the image (using ... what you are saying is that you have a colour image with RGB planes. ... a given threshold on all three planes. ...
    (comp.soft-sys.matlab)
  • Re: BYTE Article of Mega II
    ... I believe that RGB matrix is constructed by TTL gating. ... If RGB matrix is a ROM, I am sure that four NTSC pixels out of 140 NTSC pixels will display on the screen at 98% correct. ...
    (comp.sys.apple2)
  • Re: selecting a region of interest based on greyscale J value
    ... in Matlab 7.5 which is able to read an image as an RGB array, ... I want to open up a colour image in the viewer, select a few pixels ... 1, export each selected pixel into a table, storing RGB ...
    (comp.soft-sys.matlab)

Loading