# Ask about plane detection

**URL:** <https://forum.magicleap.cloud/t/ask-about-plane-detection/2151>\
**Category:** Unity Development\
**Created:** [July 3, 2023, 7:19am UTC](https://forum.magicleap.cloud/t/ask-about-plane-detection/2151 "2023-07-03T07:19:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdtien.ict](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mdtien.ict](https://forum.magicleap.cloud/u/mdtien.ict)\
**Post date:** [July 3, 2023, 7:19am UTC](https://forum.magicleap.cloud/t/ask-about-plane-detection/2151/1 "2023-07-03T07:19:28Z")

</div>

In my video attached, I am testing plane detection.  
At the beginning of the video, I was testing on the road surface and I found that the detection seemed difficult.  
In the middle of the video, I'm trying to walk on a slope and it can't detect any planes.  
At the end of the video, I go inside the lobby and it works great.  
I want to ask 2 questions:

1. Does plane detection work well outdoors? (specifically with the road surface).
2. As far as I know, plane detection only detects horizontal and vertical planes. It can't detect an inclined plane (like a slope on a road surface) right? If so, what do I need to do to make it work?  
This is my video : [ML Plane detection - YouTube](https://youtu.be/pSUWI82ZrpQ)  
**Unity Editor version** : 2022.3.1f1  
**ML2 OS version** :1.3.0  
**MLSDK version** :1.3  
**Host OS** : Window

---

<div class="post-metadata">

**Author:** ![TeraGroove](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/teragroove/32/947_2.png) [@TeraGroove](https://forum.magicleap.cloud/u/TeraGroove)\
**Post date:** [July 4, 2023, 5:14am UTC](https://forum.magicleap.cloud/t/ask-about-plane-detection/2151/3 "2023-07-04T05:14:54Z")

</div>

I also tested plane detection at an outdoor my test site.  
[road surface detection test](https://youtu.be/ymbMhU2NkKQ)

It seems that the road surface can be detected "partially".

My impression is  
"under the shade" is relatively detectable, but it seems that "under the sunny" is difficult to detect.

Is that normal?

---

<div class="post-metadata">

**Author:** ![mdtien.ict](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@mdtien.ict](https://forum.magicleap.cloud/u/mdtien.ict)\
**Post date:** [July 4, 2023, 6:44am UTC](https://forum.magicleap.cloud/t/ask-about-plane-detection/2151/4 "2023-07-04T06:44:28Z")

</div>

Looks like your roadface has better flatness than mine, can you try it on a slope?

---

<div class="post-metadata">

**Author:** ![TeraGroove](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/teragroove/32/947_2.png) [@TeraGroove](https://forum.magicleap.cloud/u/TeraGroove)\
**Post date:** [July 4, 2023, 7:00am UTC](https://forum.magicleap.cloud/t/ask-about-plane-detection/2151/5 "2023-07-04T07:00:41Z")

</div>

Okay, I will try on a "sloping road".

---

<div class="post-metadata">

**Author:** ![TeraGroove](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/teragroove/32/947_2.png) [@TeraGroove](https://forum.magicleap.cloud/u/TeraGroove)\
**Post date:** [July 5, 2023, 3:49am UTC](https://forum.magicleap.cloud/t/ask-about-plane-detection/2151/6 "2023-07-05T03:49:26Z")

</div>

I tested plane detection on the slope road.  
It seems that the road surface of the slope can also be detected.

However, it seems that some tips are needed.

- close to the road  
[slope plane detection 0705a - YouTube](https://youtu.be/A18V70xkZ2k?t=33)
- need enojght time to recognize the whole slope surface.  
[slope plane deteciton 0705b - YouTube](https://youtu.be/d4WNWwOa-sA?t=89)

I hope the Leapers will comment on the tips for accurate and speedy plane detection on outdoor (hot) slopes.

---

<div class="post-metadata">

**Author:** ![ababilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/ababilinski/32/79_2.png) [@ababilinski](https://forum.magicleap.cloud/u/ababilinski)\
**Post date:** [July 5, 2023, 5:02pm UTC](https://forum.magicleap.cloud/t/ask-about-plane-detection/2151/7 "2023-07-05T17:02:33Z")

</div>

We do not officially support outdoor environments and have not tested our APIs on outdoor surfaces such as roads or cobblestone. That said, here are some tips to possibly improve detection:

- To detect all plane orientations, make sure to update the plane query flags to include `PlanesSubsystem.Extensions.MLPlanesQueryFlags.AllOrientations`
- If it seems that the plane is too small, try adjusting the `BoundsExtents` query parameter.

I also recommend trying our [meshing api](https://developer-docs.magicleap.cloud/docs/guides/unity/perception/meshing/unity-meshing-overview) to get more accurate geometry.

---

<div class="post-metadata">

**Author:** ![TeraGroove](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/teragroove/32/947_2.png) [@TeraGroove](https://forum.magicleap.cloud/u/TeraGroove)\
**Post date:** [July 6, 2023, 12:58am UTC](https://forum.magicleap.cloud/t/ask-about-plane-detection/2151/8 "2023-07-06T00:58:42Z")

</div>

We appreciate your precise suggestions.  
Based on your suggestions, we will implement the Plane Detection function in our system.
