From: ddd ddddd on
"Tony " <ewizlab(a)gmail.com> wrote in message <h31h96$h35$1(a)fred.mathworks.com>...
> The above discussed algorithm in code
>
> % Normalizing RGB image
> % Tony Gladvin George
>
> Image_rgb = imread('image.jpg');
> Image_rgb = imresize(Image_rgb, [400 400]);
> Image_rgb = double(Image_rgb);
> %figure;imshow(uint8(Image_rgb));
>
> Image_red = Image_rgb(:,:,1);
> Image_green = Image_rgb(:,:,2);
> Image_blue = Image_rgb(:,:,3);
> %figure;imshow(uint8(Image_red));
>
> [row,col] = size(Image_rgb(:,:,1));
>
> for y = 1:row %-->numberof rows in image
> for x = 1:col %-->number of columns in the image
> Red = Image_red(y,x);
> Green = Image_green(y,x);
> Blue = Image_blue(y,x);
>
> NormalizedRed = Red/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedGreen = Green/sqrt(Red^2 + Green^2 + Blue^2);
> NormalizedBlue = Blue/sqrt(Red^2 + Green^2 + Blue^2);
>
> Image_red(y,x) = NormalizedRed;
> Image_green(y,x) = NormalizedGreen;
> Image_blue(y,x) = NormalizedBlue;
> end
> end
>
> Image_rgb(:,:,1) = Image_red;
> Image_rgb(:,:,2) = Image_green;
> Image_rgb(:,:,3) = Image_blue;
>
> Image_rgb = Image_rgb .* Image_rgb;
> Image_rgb = Image_rgb .* Image_rgb;
>
> figure; imshow(Image_rgb);


thank u for this but when i paste this code in an m file and run it gives an error
??? Error using ==> normalize at 43
A must be an ATOM.

when i click on normalize at 43 it appears normailze is some function...and matlab opens that for me

what should do to debug code without error?
From: ddd ddddd on
"ddd ddddd" <ddd(a)dd.com> wrote in message <haq6ur$bmk$1(a)fred.mathworks.com>...
> "Tony " <ewizlab(a)gmail.com> wrote in message <h31h96$h35$1(a)fred.mathworks.com>...
> > The above discussed algorithm in code
> >
> > % Normalizing RGB image
> > % Tony Gladvin George
> >
> > Image_rgb = imread('image.jpg');
> > Image_rgb = imresize(Image_rgb, [400 400]);
> > Image_rgb = double(Image_rgb);
> > %figure;imshow(uint8(Image_rgb));
> >
> > Image_red = Image_rgb(:,:,1);
> > Image_green = Image_rgb(:,:,2);
> > Image_blue = Image_rgb(:,:,3);
> > %figure;imshow(uint8(Image_red));
> >
> > [row,col] = size(Image_rgb(:,:,1));
> >
> > for y = 1:row %-->numberof rows in image
> > for x = 1:col %-->number of columns in the image
> > Red = Image_red(y,x);
> > Green = Image_green(y,x);
> > Blue = Image_blue(y,x);
> >
> > NormalizedRed = Red/sqrt(Red^2 + Green^2 + Blue^2);
> > NormalizedGreen = Green/sqrt(Red^2 + Green^2 + Blue^2);
> > NormalizedBlue = Blue/sqrt(Red^2 + Green^2 + Blue^2);
> >
> > Image_red(y,x) = NormalizedRed;
> > Image_green(y,x) = NormalizedGreen;
> > Image_blue(y,x) = NormalizedBlue;
> > end
> > end
> >
> > Image_rgb(:,:,1) = Image_red;
> > Image_rgb(:,:,2) = Image_green;
> > Image_rgb(:,:,3) = Image_blue;
> >
> > Image_rgb = Image_rgb .* Image_rgb;
> > Image_rgb = Image_rgb .* Image_rgb;
> >
> > figure; imshow(Image_rgb);
>
>
> thank u for this but when i paste this code in an m file and run it gives an error
> ??? Error using ==> normalize at 43
> A must be an ATOM.
>
> when i click on normalize at 43 it appears normailze is some function...and matlab opens that for me
>
> what should do to debug code without error?


sry that was my mistake....i named my m file as normalize rbg.m and therefore when i was running that it was running normalize.m which is predefined in some toolbox?

neways thank u very much for the code