I need to segment out anomalies in a greyscale image. In a certain place in my algorithm, I compute a matrix that contains the known pixel intensities that I need to set to zero. How would I do this?
For example:
The computed pixel intensities:
(array([ 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
146, 147, 148, 149, 150, 151]),)
The picture is of size (480,640) :
Printed it gives:
[[ 86 90 97 ..., 142 152 157]
[ 85 89 97 ..., 145 154 158]
[ 83 87 95 ..., 154 158 159]
...,
[130 134 139 ..., 156 154 154]
[130 134 140 ..., 154 153 152]
[130 134 141 ..., 154 153 152]]
I realize that for each pixel I could go through the intensity matrix. This would, however, be too expensive. NumPy experts I need your help!