class_docstr: Crops the size of the observation to a given crop window. For example, in Atari, the
  observations are images with a shape of 210x160. Usually, we will want to crop the size of the observation to a
  square of 160x160 before rescaling them.
docstr: :param crop_low: a vector where each dimension describes the start index for cropping the observation in the
                   corresponding dimension. a negative value of -1 will be mapped to the max size
  :param crop_high: a vector where each dimension describes the end index for cropping the observation in the
                    corresponding dimension. a negative value of -1 will be mapped to the max size
code: def __init__(
      self, crop_low: np.ndarray = None, crop_high: np.ndarray = None
  ):
      """
      :param crop_low: a vector where each dimension describes the start index for cropping the observation in the
                       corresponding dimension. a negative value of -1 will be mapped to the max size
      :param crop_high: a vector where each dimension describes the end index for cropping the observation in the
                        corresponding dimension. a negative value of -1 will be mapped to the max size
      """
      super().__init__()
      if crop_low is None and crop_high is None:
          raise ValueError(
              "At least one of crop_low and crop_high should be set to a real value. "
          )
      if crop_low is None:
          crop_low = np.array([0] * len(crop_high))
      if crop_high is None:
          crop_high = np.array([-1] * len(crop_low))
  
      self.crop_low = crop_low
      self.crop_high = crop_high
  
      for h, l in zip(crop_high, crop_low):
          if h < l and h != -1:
              raise ValueError(
                  "Some of the cropping low values are higher than cropping high values"
              )
      if np.any(crop_high < -1) or np.any(crop_low < -1):
          raise ValueError("Cropping values cannot be negative")
      if crop_low.shape != crop_high.shape:
          raise ValueError(
              "The low values and high values for cropping must have the same number of dimensions"
          )
      if crop_low.dtype != int or crop_high.dtype != int:
          raise ValueError(
              "The crop values should be int values, instead they are defined as: {} and {}".format(
                  crop_low.dtype, crop_high.dtype
              )
          )
  
file_path: coach/rl_coach/filters/observation/observation_crop_filter.py
imports: from typing import Union, Tuple
  import numpy
  from rl_coach.core_types import ObservationType
  from rl_coach.filters.observation.observation_filter import ObservationFilter
  from rl_coach.spaces import ObservationSpace
label_desc: Use image node_id 1 to create a new ObservationCropFilter object from inherited base classes: ObservationFilter with example: obj = ObservationCropFilter(crop_low, crop_high)