# (solved)Surface matching example: Error opening input file

**URL:** <https://forum.opencv.org/t/solved-surface-matching-example-error-opening-input-file/5386>\
**Category:** Python\
**Tags:** contrib, surface\_matching\
**Created:** [September 28, 2021, 6:18am UTC](https://forum.opencv.org/t/solved-surface-matching-example-error-opening-input-file/5386 "2021-09-28T06:18:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stormholt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/stormholt/32/3271_2.png) [@Stormholt](https://forum.opencv.org/u/Stormholt)\
**Post date:** [September 28, 2021, 6:18am UTC](https://forum.opencv.org/t/solved-surface-matching-example-error-opening-input-file/5386/1 "2021-09-28T06:18:55Z")

</div>

When trying to run the ‘ppf\_load\_match.py’ from opencv-contrib example files from here

> <https://github.com/opencv/opencv_contrib/tree/master/modules/surface_matching/samples>
>
> //github.com/opencv/opencv\_contrib/tree/master/modules/surface\_matching/samples

I receive an error at:

```auto
pc = cv.ppf_match_3d.loadPLYSimple("data/%s.ply" % modelname, 1)

```

The error:  
OpenCV(4.5.3) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-u4kjpz2z\opencv\_contrib\modules\surface\_matching\src\ppf\_helpers.cpp:81: error: (-2:Unspecified error) in function ‘cv::ppf\_match\_3d::loadPLYSimple’

> Error opening input file: data/parasaurolophus\_6700.ply

It doesn’t matter which ply files i try or where i put them, i always get this error.

What am i missing ? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [September 28, 2021, 7:17am UTC](https://forum.opencv.org/t/solved-surface-matching-example-error-opening-input-file/5386/2 "2021-09-28T07:17:10Z")

</div>

> [@Stormholt](#):
>
> It doesn’t matter which ply files i try or where i put them, i always get this error.

it DOES matter, where you put it.  
the sample assumes, `data` is a subfolder of the one, where you start the script  
so either [start your script here](https://github.com/opencv/opencv_contrib/tree/master/modules/surface_matching/samples) or hack the sample code

> [@Stormholt](#):
>
> `pc = cv.ppf_match_3d.loadPLYSimple("/absolute/path/to/modelname", 1)`

---

<div class="post-metadata">

**Author:** ![Stormholt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/stormholt/32/3271_2.png) [@Stormholt](https://forum.opencv.org/u/Stormholt)\
**Post date:** [September 28, 2021, 7:40am UTC](https://forum.opencv.org/t/solved-surface-matching-example-error-opening-input-file/5386/3 "2021-09-28T07:40:26Z")

</div>

Indeed it does matter, i changed the loadSimplePLY argument to fit the path of the files whenever i changed their location. However i only tried the path relative to the python file. But your tip of using the absolute path did work!  
The code ended up like so :

```auto
pc = cv.ppf_match_3d.loadPLYSimple(r'C:\Users\Stormholt\Documents\GitHub\opencv_contrib\modules\surface_matching\samples\data\parasaurolophus_6700.ply', 1)

```

Thank you for your help!
