I'm trying to make a Warning System which tells the User that there is something coming in the direction to the Camera.
So if something or somebody is approaching and only 1-2 meters in front, i want to tell it the User. Camera direction is rear facing.
Now i don't really now how to implement this. May you please give me ideas on how i could do this ?
Thanks in advance,
David
链接已复制
This reminds me of a project called SAW that some Intel employees were doing with RealSense a couple of years ago. It was designed for vision-impaired users. Vibration pads were attached to parts of the body, and when something approached a certain point of the body, the appropriate pad vibrated to warn the wearer of imminent collision.
https://software.intel.com/en-us/spatial-awareness-wearable Spatial Awareness Wearable | Intel® Software
Edit: I dug out the link to a long piece I wrote to the SAW team at the time, offering them my thoughts on the subject.
https://software.intel.com/en-us/forums/realsense-saw/topic/593558 SAW - my first thoughts
A simple way would be to average out all the depth values for each frame and track when the average distance starts decreasing.
If you want to make it more complex you could use face/hand/person/blob tracking so only the tracked areas of the image are used for the depth calculations.
Use https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?acquireaccess_pxcimage.html AcquireAccess on the depth image, then https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?toshortarray_imagedata_pxcmimage.html ToShortArray on the outputted image data, then finally just sum up all the values in that array (you may want to exclude zeroes) and divide by the number of elements, and check if the result is bigger or smaller than last time. (Also don't forget to use https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?acquireaccess_pxcimage.html ReleaseAccess to avoid memory leaks)
I believe you either need to alter the values the pointers are directing you to directly or use memcpy in C++. You can find some examples http://https//www.google.co.uk/search?q=realsense+memcpy&rlz=1C1MSNA_enGB635GB635&oq=realsense+memcpy&aqs=chrome..69i57.2629j0j7&sourceid=chrome&ie=UTF-8# q=realsense+memcpy+site:software.intel.com here.
