KirillLykov / oni2avi

Command-line converter from oni (OpenNI) to avi data format
Other
12 stars 10 forks source link

Avi 2 oni #4

Closed dimo62dimo closed 10 years ago

dimo62dimo commented 10 years ago

hi dear Mr Lykov i used ur oni2avi codec.it works very well thank u so much Is there any way that we can make an oni file by joining those img.avi and depth.avi together? how its possible? how can we calculate PSNR of original oni file n the convented oni file from avi? any help appreciated

KirillLykov commented 10 years ago

Hi there, It work only one way (from oni to avi/images). Of course, it is possible to write a tool for vise-versa transformation, but I didn't do that. However, it looks straightforward for me - open two avi files using OpenCV, than save convert rbc image and depth to appropriate formats for OpenNI (or use OpenCS's wrapper called Highgui - http://docs.opencv.org/doc/user_guide/ug_highgui.html). Yet you need to know that the depth.avi you get from my tool is not real depth from the sensor. First, If you just store depth data to pictures, you will get almost black rectangle because of the depth values range. Just check out option --depth-png=yes - pictures are almost black and you cannot see anything meaningful from them, this tis the raw depth data. Second, when you use avi, it might use compression inside. Thus you lose quality of the depth information. Oh, I have no clue. But it seems like a comparing apples with oranges since in oni file there is both picture and depth data, in oni - only images. So what do you want to compare with what? The only thing which come to my mind is to compare the img.avi with depth.avi. They are somehow similar, for shure. You can do it in the code using OpenCV if you are comfortable with C++. http://docs.opencv.org/doc/tutorials/highgui/video-input-psnr-ssim/video-input-psnr-ssim.html

dimo62dimo commented 10 years ago

yes it was very usefull and ofcource i stared it the problem is that im not good at c++ especially openCV would u please add avi2oni convertor?i found it very intresting ur codect works properly n with high speed how is it possible to convert oni2 yuv?is there any way to do some changes in ur code and save files with yuv extension? again thank u so much for ur complete reply

KirillLykov commented 10 years ago

Every video frame is saved into Mat object - for instance, check out line 210. So to convert images to yuv, do smth like that on the line 212: cv::cvtColor(image, image, CV_BGR2YCrCb); I'm too busy now to do coding, so if you really need avi2oni - I advice to try to write it yourself, simpler than it seems. And also it is a good skill Good luck