Hello,

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 ?

Thanks in advance ..

Jowana

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...

Hello,

great ! that helped.

Thanks alot .

jowana

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.