Items with no label
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
3338 讨论

Detect approaching things

DCunn2
初学者
2,605 次查看

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

0 项奖励
9 回复数
MartyG
名誉分销商 III
1,131 次查看

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

0 项奖励
DCunn2
初学者
1,131 次查看

Thanks for the quick responses !

This project looks really promising. I will take a look at it. Thank you Marty!

0 项奖励
jb455
重要分销商 II
1,131 次查看

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.

0 项奖励
DCunn2
初学者
1,131 次查看

I forgot to mention that the User is moving, so i guess the tracking would be to complex.

Taking out the average depth sounds good. Can you give me an insight on how i could do this?

I'm developing with Unity and C# . I guess i need to do this in the DrawImages method.

0 项奖励
jb455
重要分销商 II
1,131 次查看

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)

0 项奖励
MKank1
新手
1,131 次查看

If I am using C++ is there another method to use instead of "ToshortArray" or will it work if I manually create an array to hold the data?

0 项奖励
jb455
重要分销商 II
1,131 次查看

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.

0 项奖励
MKank1
新手
1,131 次查看

Yup, i will have a go thanks. Also could you see if there is a problem with the link you just posted? It gives me a "Site cannot be reached" error.

0 项奖励
jb455
重要分销商 II
1,131 次查看

Yeah, not sure what's happened there. I just googled "realsense memcpy site:software.intel.com" (no quotes)!

0 项奖励
回复