Neural Networks Warehouse
Artificial Intelligence Depot
"As knowledge increases, ignorance unfolds." -Kennedy
KNOWLEDGE MESSAGES SUBMIT SEARCH  
need help in coding with matlab
 
• need help in coding with matlab

hello all. I realy need help in coding with matlab. I try to built an object recognation with ANN and i need some value for the input node. the problem is I don't know how to extract it. here are some of my problem :
1. how can I get the RGB value from one pixel. and I want to get the each of value ( each value of R,G and B)

2. how can I change the color of pixel in image? my image was using a solid white background. and now I want to make change like this :
"all pixel with white color change to black and all pixel that not white color change to white". i use code like this but it failed

for c =1: 480000
if b (c) > 250
b(c) = 0;
else
b(c) = 255;
end
end;

3. As you can see in my code above I use an single looping. how can I change this code into matlab code

for i = 1 to 800
for j = 1 to 600
if b [i][j] > 250
b[i][j] = 0;
else
b [i][j] = 255;
in other word I want to know how to access array row and column in matlab.

thanks very much. sorry if my post is extremly long, but I'm desperate in need of help

1 posts.
Wednesday 22 November, 20:39
Reply
• better way

please have a look in help of matlab

there is a function im2bw and imcomplement for the purpose

when the pixel is white there is no need of intensity having 255 it can be 1 as well that is BW

2 posts.
Wednesday 24 January, 16:47
Reply