Re: How to put pixels and RGB in m-file??
- From: sid <amir_sids@xxxxxxxxxxx>
- Date: Wed, 10 Aug 2005 06:55:30 -0400
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
.
- Follow-Ups:
- Re: How to put pixels and RGB in m-file??
- From: Inpakala Simon
- Re: How to put pixels and RGB in m-file??
- References:
- How to put pixels and RGB in m-file??
- From: sid
- Re: How to put pixels and RGB in m-file??
- From: Dave Robinson
- How to put pixels and RGB in m-file??
- Prev by Date: Re: to get rid of identifical lines
- Next by Date: Re: Mex Pointer initialisation
- Previous by thread: Re: How to put pixels and RGB in m-file??
- Next by thread: Re: How to put pixels and RGB in m-file??
- Index(es):
Relevant Pages
|
Loading