GithubHelp home page GithubHelp logo

Camera calibration parameter about pyk4a HOT 4 CLOSED

etiennedub avatar etiennedub commented on July 30, 2024
Camera calibration parameter

from pyk4a.

Comments (4)

lpasselin avatar lpasselin commented on July 30, 2024

This could be documented better. Both in our wrapper and on the official SDK.

See functions save_calibration_jsonand load_calibration_json

def save_calibration_json(self, path: Any):

def load_calibration_json(self, path: Any):

You should use save_calibration_json first to have a template.
An example can be found here: https://github.com/etiennedub/pyk4a/blob/6d1355a1ee994fddcabb48501586b058671c9443/tests/assets/calibration.json

from pyk4a.

zhaocheng-hub avatar zhaocheng-hub commented on July 30, 2024

可以更好地记录下来。 无论是在我们的包装中还是在官方SDK中。

查看功能 save_calibration_jsonload_calibration_json

def save_calibration_json(self, path: Any):

def load_calibration_json(self, path: Any):

您应该 使用 save_calibration_json首先 一个模板。
可以在这里找到一个示例: : https //github.com/etiennedub/pyk4a/blob/6d1355a1ee994fddcabb48501586b058671c9443/tests/assets/calibration.json

@lpasselin
I try to change some data manually, and try to use k4a. load_ calibration_ json to read the data of "JSON" in the path I specified. And k4a.calibration_raw is printed with print There is no change in the attribute of k4a.calibration_raw.

In addition, through k4a.save_calibration_json saves "JSON" data, it is effective. It changes the original "json" data (but the style becomes only one line of code instead of the style of the template you gave me).

I will k4a.load_calibration_json in the main function, I found that he successfully printed my modified "json", but this method still can't change k4a.calibration_raw

Maybe my usage is wrong. Can you give me an example?

from pyk4a.

shagren avatar shagren commented on July 30, 2024

You can use high level api: create Calibration from string and then use it for image transformation or coordinates translation

calibration = Calibration.from_raw(json_string, DepthMode.NFOV_UNBINNED, ColorResolution.RES_1080P)
transormed_image =  depth_image_to_color_camera(depth_image, calibration) 
color_x, color_y, color_z  = calibration.depth_to_color_3d((depth_x, depth_y, depth_z)) # 3d coordinates from Depth camera space to Color camera space

from pyk4a.

zhaocheng-hub avatar zhaocheng-hub commented on July 30, 2024

您可以使用高级api:根据字符串创建校准,然后将其用于图像转换或坐标转换

calibration = Calibration.from_raw(json_string, DepthMode.NFOV_UNBINNED, ColorResolution.RES_1080P)
transormed_image =  depth_image_to_color_camera(depth_image, calibration) 
color_x, color_y, color_z  = calibration.depth_to_color_3d((depth_x, depth_y, depth_z)) # 3d coordinates from Depth camera space to Color camera space

Thank you for your reply, this method is effective.

from pyk4a.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.