0
$\begingroup$

Rosanswers logo

EDITED:

Hello,

I am new to image processing in ROS, but I have some experience with opencv and what I want to do is to read two frames in row from kinect, take their absolute difference and detect a moving object in real time.

To be more specific, I want to implement the logic of :

videoCapture::read(cv::Mat frame1);
videoCapture::read(cv::Mat frame2);

in the logic of ROS (the logic of messages).

How can I achieve that?

I have previously worked with the kinect v2 and managed to detect an object with its color, so I think I know most of the basics about image transportation, but I am a bit confused on how could I implement the logic of the following frames above in ROS.

Thanks for answering and for your time in advance, Chris


Originally posted by patrchri on ROS Answers with karma: 354 on 2016-10-07

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Do you already have access to the Kinect data? If not, I would check out these tutorials here.

Edit: Alright, I understand your issue now. What you are describing with image processing does not really depend on ROS, I imagine you would be using OpenCV like you mentioned in original post.

Not sure how you are getting your frame data from Kinect, but just store it in a buffer array (allocate memory) and wait for the next frame and do the same (allocate memory). Then compute your image processing functions. Overwrite the old frame with the new frame, and obtain the next frame and store it in the new frame. Repeat. If you need more assistance with image processing, try a basic search online, there are many tutorials out there for it.


Originally posted by JoshMarino with karma: 592 on 2016-10-07

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by patrchri on 2016-10-08:
I have access, because I have implemented object detection with the object's color. I am also using Kinect v2.

Comment by JoshMarino on 2016-10-08:
Sorry, what I meant to ask is can you get the Kinect data through using ROS with something like openni_launch package? If so, it is a matter of subscribing to the topic (image data) and then using whatever algorithms you want to.

Comment by patrchri on 2016-10-09:
I can get data from another node....My issue is not the data...

Comment by JoshMarino on 2016-10-09:
I do not understand your problem then. You asked how read two frames from the Kinect, but you are saying you can already do that?

Comment by patrchri on 2016-10-09:
I am asking how to read two in a row frames and do something with their difference. This means that I have to keep one frame/message temporarily, get its following one, do something with these 2 frames/messages, discard the temporary message and do this process again...

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.