I have a line on my image and i want to find the maximim grey-level value on that line . so i need to scan the line and pick the pixel with the highest value
how can I do this?
should I calculat the gradient magnitude ?
No. The gradient is the highest *CHANGE* in grey value. The maximum is what you want.
Just initialise a variable maxval=0; then in a loop whenever you find a value > maxval then set it to the new maxval. Iterate through all greyvalues on your line. done.
If however you need to *FIND* the pixels that belong to the line then the gradient will come in handy depending on the algorithm you use...