Giter Site home page Giter Site logo

Comments (17)

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

Hi,

I had not considered to add playback. Is there any benefit on using the built in record function instead of saving the images using OpenCV?

However, I think adding playback to visualize already recorded data could be interesting. For example, record the data using the visualizer in the Kinect Azure SDK and then read that playback in python to perform some processing. I will look into that this weekend if I have time.

Ibai

from pykinectazure.

lsding avatar lsding commented on June 14, 2024

Hi
I have already resolved it,
record and playback functions are in k4arecord.dll.
Thank you for your reply.

from pykinectazure.

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

I am glad to hear that. Could you add a link to your code?

It might help other people that want that also.

Ibai

from pykinectazure.

lsding avatar lsding commented on June 14, 2024

class k4a:

def __init__(self, modulePath):
    try:
        dll = ctypes.CDLL(modulePath)
        recorddll = ctypes.CDLL(modulePath.replace('k4a.dll', 'k4arecord.dll'))
    except Exception as e:
        try:
            dll = ctypes.CDLL('k4a.so')
            recorddll = ctypes.CDLL('k4arecord.so')
        except Exception as ee:
            print("Failed to load library", e, ee)
            sys.exit(1)

    self.k4a_record_create = recorddll.k4a_record_create
    self.k4a_record_create.restype = k4a_result_t
    self.k4a_record_create.argtypes = (ctypes.POINTER(ctypes.c_char), \
                                       k4a_device_t, \
                                       k4a_device_configuration_t, \
                                       ctypes.POINTER(k4a_record_t),\
                                       )

    self.k4a_record_write_header = recorddll.k4a_record_write_header
    self.k4a_record_write_header.restype = k4a_result_t
    self.k4a_record_write_header.argtypes = (k4a_record_t,)

    self.k4a_record_write_capture = recorddll.k4a_record_write_capture
    self.k4a_record_write_capture.restype = k4a_result_t
    self.k4a_record_write_capture.argtypes = (k4a_record_t, \
                                              k4a_capture_t)

    self.k4a_record_flush = recorddll.k4a_record_flush
    self.k4a_record_flush.restype = k4a_result_t
    self.k4a_record_flush.argtypes = (k4a_record_t,)

    self.k4a_record_close = recorddll.k4a_record_close
    self.k4a_record_close.restype = None
    self.k4a_record_close.argtypes = (k4a_record_t,)

    self.k4a_playback_open = recorddll.k4a_playback_open
    self.k4a_playback_open.restype = k4a_result_t
    self.k4a_playback_open.argtypes = (ctypes.POINTER(ctypes.c_char), \
                                       ctypes.POINTER(k4a_playback_t),)

    self.k4a_playback_close = recorddll.k4a_playback_close
    self.k4a_playback_close.restype = None
    self.k4a_playback_close.argtypes = (k4a_playback_t,)

    self.k4a_playback_get_next_capture = recorddll.k4a_playback_get_next_capture
    self.k4a_playback_get_next_capture.restype = k4a_stream_result_t
    self.k4a_playback_get_next_capture.argtypes = (k4a_playback_t, \
                                                   ctypes.POINTER(k4a_capture_t),)

    self.k4a_playback_get_calibration = recorddll.k4a_playback_get_calibration
    self.k4a_playback_get_calibration.restype = k4a_result_t
    self.k4a_playback_get_calibration.argtypes = (k4a_playback_t, \
                                                ctypes.POINTER(k4a_calibration_t), \
                                                )

from pykinectazure.

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

Thank you @lsding, I will try to test it this weekend and added it to the repository.

from pykinectazure.

donghaoye avatar donghaoye commented on June 14, 2024

Thank you @lsding, I will try to test it this weekend and added it to the repository.

Hi, Did you add it to the repos?

from pykinectazure.

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

Actually, I did not. In order to test it I had to also modify other parts of the code.

I might give it a try now.

from pykinectazure.

donghaoye avatar donghaoye commented on June 14, 2024

Actually, I did not. In order to test it I had to also modify other parts of the code.

I might give it a try now.

Great! Could you give some examples of playback and record?

from pykinectazure.

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

Working on that now. I will try to upload them in a couple of hours.

from pykinectazure.

donghaoye avatar donghaoye commented on June 14, 2024

Working on that now. I will try to upload them in a couple of hours.

Thank you so much. Looking forward to your good news.

from pykinectazure.

donghaoye avatar donghaoye commented on June 14, 2024

Working on that now. I will try to upload them in a couple of hours.

Nice job! Very glad to see the recording example.
Could you add a playback example in the following hours? Thank you.

from pykinectazure.

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

Working on that also, but it is a bit more nested with the k4a library. It might take a while.

from pykinectazure.

donghaoye avatar donghaoye commented on June 14, 2024

Working on that also, but it is a bit more nested with the k4a library. It might take a while.

Thanks for your efforts. Have you made any progress on it?

from pykinectazure.

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

I have ended up doing a major refactor to the repository, I almost have finished but there are some parts that are not working correctly.

I will probably finish it this weekend (no time during the week).

from pykinectazure.

egeozsoy avatar egeozsoy commented on June 14, 2024

Any updates here?

from pykinectazure.

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

I am still busy with other projects, my recommendation for now is to use this other repository:
https://github.com/etiennedub/pyk4a/tree/master/pyk4a

from pykinectazure.

ibaiGorordo avatar ibaiGorordo commented on June 14, 2024

As mentioned in #35:
"I have uploaded a major refactor that was long overdue. I have added an example "examplePlaybackBodyTracker.py" to perform body tracking in a recording that did not have body tracking enabled."

from pykinectazure.

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.