Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

About picture information acquisition and resizing #16

@aaaa47080

Description

@aaaa47080

Exceuse me, @saierd saierd, The first point is that I want to start from ITM_ RENDER_ POINT_ Depth information was extracted from map, but ITM was found_ RENDER_ POINT_ There are three channels in the map. I have looked at each channel separately and can probably confirm whether the second channel (respectively) is our real depth information.Sorry i can't find reopen choose so i recreate a issue.

Supplement: my original idea was that depth information is a single channel, but I can't seem to find depth information with only a single channel. So we can only grab the depth information in this way. If I want you to tell me how to get such information,and below is my code

from ensenso_nxlib import NxLibCommand, NxLibItem
from ensenso_nxlib.constants import *
import ensenso_nxlib
import cv2
import pandas as pd
import numpy as np

stereo_serial = "193244"
mono_serial = "4103989237"

ensenso_nxlib.api.initialize()

cmd = NxLibCommand(CMD_OPEN)
cmd.parameters()[ITM_CAMERAS][0] = stereo_serial
cmd.parameters()[ITM_CAMERAS][1] = mono_serial
cmd.execute()


stero_cam = NxLibItem()[ITM_CAMERAS][stereo_serial]
param = json.dumps(json.load(open('parameter5.json', "r")))
stero_cam << param
print('Load the stereo Camera parameter file....')

mono_cam = NxLibItem()[ITM_CAMERAS][mono_serial]
param = json.dumps(json.load(open('parameter5.json', "r")))
mono_cam << param
print('Load the  mono  Camera parameter file....')



NxLibCommand(CMD_CAPTURE).execute()
NxLibCommand(CMD_COMPUTE_DISPARITY_MAP).execute()
NxLibCommand(CMD_COMPUTE_POINT_MAP).execute()


#parameters_tree_json =  json.dumps(json.load(open('23.json', "r")))
cmd = NxLibCommand(CMD_RENDER_POINT_MAP)
cmd.parameters()[ITM_SIZE] = [256, 256]
# cmd.parameters()[ITM_SIZE] << parameters_tree_json
par = cmd.parameters().as_json()
# print(par)
cmd.execute()

depth = NxLibItem()[ITM_IMAGES][ITM_RENDER_POINT_MAP].get_binary_data()

depth_1 = depth[:,:,0]
depth_2 = depth[:,:,1]
depth_3 = depth[:,:,2]

And another question is to continue the question just now
I want to get the depth channel from the code above. Its size is 768 * 1024, but I want to modify it to 256 * 256
I use cmd.parameters() [itm_size] = [256, 256] and other mentioned by Mr. before cmd.parameters()[ITM_SIZE] << parameters_numpy_Array method, but the final images are 768 * 1024, otherwise there will be errors, so I want to ask you how to correctly adjust the image size. Sorry to bother you, sir

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions