tags:

views:

60

answers:

3

I want to test each pixel in an image and check it's color if it is white then I must display the corresponding (x,Y) for that pixel but I didn't find until now a function that help me do something like that. So please if you have such function tell me.

thanks at all

A: 

If you are using matlab for image editting, the function for this purpose would be imread, i.e. if you have a M*N image them imread would split it in a matrix of [M*N*3], i.e. a 3 dimensional array representing RGB components of the image. Now if at a given X,Y coordinate, all the three i.e. Red, Green and Blue components have equal value, then that pixel is not color. If they have different values then it is coloured pixel. Using an if condition check and generate a new picture matrix accordingly. Display the new picture matrix.

stack programmer
A: 

I don't know if there is such a function. maybe in some deep graphics toolkit? it'll certainly not be part of a basic language framework (i.e. core stuff in objc or system in c#).

you might have to bite the bullet and just work your way through all of the pixels manually in o(n^2).

foreach horizontal pixel
    foreach vertical pixel
         if(pixel at (horizontal,vertical) is white)
             return (horizontal, vertical)
Oren Mazor
A: 

thanks for your answers, but I forgot to say that I'm working with MatLab Language Stack programmmaer , hi actually I'm new with Matlab how can I use if condition to generate such matrix can you help me

Dani