View my account

How can i resize d435's depth frame?

Comments

3 comments

  • MartyX Grover

    Hi Blake58  As you are already using cv, an appropriate way to perform image resizing in your project may be to use cv2.resize.  

    https://www.geeksforgeeks.org/image-resizing-using-opencv-python/

    The SDK Python example opencv_viewer_example.py demonstrates use of this command.

    https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/opencv_viewer_example.py#L52

    -1
    Comment actions Permalink
  • Blake58

    good to see you again Marty, I tried cv2.resize, but, it did'nt worked. Bunt, i found other solution of this.

    my tensorflow model's input size was 150 X 150 size. so we changed input size of model from this

    model = tf.keras.models.Sequential([
    tf.keras.layers.Conv2D(16, (3,3), activation='relu', input_shape=(150, 150,3)),
    tf.keras.layers.MaxPooling2D(2,2),
    tf.keras.layers.Conv2D(32, (3,3), activation='relu'),
    tf.keras.layers.MaxPooling2D(2,2),
    tf.keras.layers.Conv2D(64, (3,3), activation='relu'),
    tf.keras.layers.MaxPooling2D(2,2),
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(512, activation='relu'),
    tf.keras.layers.Dense(3, activation='softmax')
    ])

    to this

    model = tf.keras.models.Sequential([
    tf.keras.layers.Conv2D(16, (3,3), activation='relu', input_shape=(640, 480,3)),
    tf.keras.layers.MaxPooling2D(2,2),
    tf.keras.layers.Conv2D(32, (3,3), activation='relu'),
    tf.keras.layers.MaxPooling2D(2,2),
    tf.keras.layers.Conv2D(64, (3,3), activation='relu'),
    tf.keras.layers.MaxPooling2D(2,2),
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(512, activation='relu'),
    tf.keras.layers.Dense(3, activation='softmax')
    ])


    then, it worked. Thanks for reply

    0
    Comment actions Permalink
  • MartyX Grover

    Excellent news that you found a solution - thanks so much for sharing it with the RealSense community!

    0
    Comment actions Permalink

Please sign in to leave a comment.