MATLAB: Finding the coordinates of points with maximum intensity

image processingImage Processing Toolboximage segmentation

i have a image file of a welded metal in jpg format. In the image ,the defect in welding appears as an object having maximum intensity.I need a code that can convert the coordinates having intensity above a certain given threshold to '1' and all other points below threshold to '0'. please help. thanks

Best Answer

If "I" is your intensity image and your threshold is stored in "thresh" pretty much all you need to do is:
mask= I>Thresh
Mask would have 1 for every pixel that has the intensity more than the threshold and the rest would be zero.