Computes the normalized difference between two bands. If the bands to use are not specified, uses the first two bands. The normalized difference is computed as (first − second) / (first + second). Note that the returned image band name is 'nd', the input image properties are not ret
(
self,
# pylint: disable-next=invalid-name
bandNames: _arg_types.Any | None = None,
)
| 2979 | return apifunction.ApiFunction.call_(self.name() + '.neq', self, image2) |
| 2980 | |
| 2981 | def normalizedDifference( |
| 2982 | self, |
| 2983 | # pylint: disable-next=invalid-name |
| 2984 | bandNames: _arg_types.Any | None = None, |
| 2985 | ) -> Image: |
| 2986 | """Computes the normalized difference between two bands. |
| 2987 | |
| 2988 | If the bands to use are not specified, uses the first two bands. The |
| 2989 | normalized difference is computed as (first − second) / (first + second). |
| 2990 | Note that the returned image band name is 'nd', the input image properties |
| 2991 | are not retained in the output image, and a negative pixel value in either |
| 2992 | input band will cause the output pixel to be masked. To avoid masking |
| 2993 | negative input values, use `ee.Image.expression()` to compute normalized |
| 2994 | difference. |
| 2995 | |
| 2996 | Args: |
| 2997 | bandNames: A list of names specifying the bands to use. If not specified, |
| 2998 | the first and second bands are used. |
| 2999 | |
| 3000 | Returns: |
| 3001 | An ee.Image. |
| 3002 | """ |
| 3003 | |
| 3004 | return apifunction.ApiFunction.call_( |
| 3005 | self.name() + '.normalizedDifference', self, bandNames |
| 3006 | ) |
| 3007 | |
| 3008 | def Not(self) -> Image: |
| 3009 | """Returns 0 if the input is non-zero, and 1 otherwise.""" |