# Detecting features between image and stl

**URL:** <https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022>\
**Category:** Python\
**Tags:** calib3d\
**Created:** [September 1, 2021, 8:52pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022 "2021-09-01T20:52:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Callan\_Herberger](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/callan_herberger/32/196_2.png) [@Callan\_Herberger](https://forum.opencv.org/u/Callan_Herberger)\
**Post date:** [September 1, 2021, 8:52pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/1 "2021-09-01T20:52:02Z")

</div>

I am trying to match an image of a build plate (square with some holes in the corners) to an stl of the build plate. I want to rotate the stl of the build plate to match the angle from the camera. can this be done? should i be using feature detect?

---

<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 1, 2021, 9:03pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/2 "2021-09-01T21:03:32Z")

</div>

show images, please …

---

<div class="post-metadata">

**Author:** ![Callan\_Herberger](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/callan_herberger/32/196_2.png) [@Callan\_Herberger](https://forum.opencv.org/u/Callan_Herberger)\
**Post date:** [September 1, 2021, 9:43pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/3 "2021-09-01T21:43:08Z")

</div>

![Screenshot 2021-09-01 3.41.15 PM](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/2/2bdb36193893dfd0d1d0cd6fa0021f59d362f1e5.png)

I do not have pictures of the final build plate but something along the lines of this.

---

<div class="post-metadata">

**Author:** ![Callan\_Herberger](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/callan_herberger/32/196_2.png) [@Callan\_Herberger](https://forum.opencv.org/u/Callan_Herberger)\
**Post date:** [September 1, 2021, 9:43pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/4 "2021-09-01T21:43:41Z")

</div>

![Can-build](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/d/d8c1de9a9cc174b391a0aac52cc7f157b904539c.jpeg)

and here is the photo i want to match the stl with

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [September 1, 2021, 10:01pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/5 "2021-09-01T22:01:13Z")

</div>

that picture is nearly useless.

could you perhaps explain _why_ you need this (purpose), and what alternatives to _doing that_ are on the table, and what alternatives have been discarded, for what reasons? that might help readers care about the problem. as it is, it seems like a tedious problem that likely shouldn’t even be solved because it only exists because of your choice of solution to _another_ problem that’s the real one.

---

<div class="post-metadata">

**Author:** ![Callan\_Herberger](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/callan_herberger/32/196_2.png) [@Callan\_Herberger](https://forum.opencv.org/u/Callan_Herberger)\
**Post date:** [September 1, 2021, 10:08pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/6 "2021-09-01T22:08:18Z")

</div>

i’m trying to match an stl with a camera watching a 3d printer. but i need the two images to be in the same orientation so they can be compared accurately. i’ve used homography to find similar points in the two images but if they are not lined up correctly the points are all wrong. so i want to do

1. find the angle the build plate is relative to the camera
2. take that translation/rotation matrix and the rotate the stl and take slices to compare to the images from a camera

---

<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 1, 2021, 10:33pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/7 "2021-09-01T22:33:17Z")

</div>

> [@crackwitz](#):
>
> that picture is nearly useless.

id say so, too. (for \*feature matching)  
also, whatever 2d _rendering_ of your stl will even be worse.

feature matching needs _texture_, all you have is outlines

btw, remove the python tag ?  
(its not about languages, more a “fundamental cv” thing)

---

<div class="post-metadata">

**Author:** ![Callan\_Herberger](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/callan_herberger/32/196_2.png) [@Callan\_Herberger](https://forum.opencv.org/u/Callan_Herberger)\
**Post date:** [September 1, 2021, 10:38pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/8 "2021-09-01T22:38:36Z")

</div>

Okay, then looks like i will be using corner detection

---

<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 1, 2021, 10:42pm UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/9 "2021-09-01T22:42:39Z")

</div>

gl.  
garbage in, garbage out, i’m afraid

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [September 2, 2021, 12:25am UTC](https://forum.opencv.org/t/detecting-features-between-image-and-stl/5022/10 "2021-09-02T00:25:14Z")

</div>

the camera doesn’t move, right?

calibrate the camera’s position relative to the **build platform** , not a random model.

have the user print some 1-layer aruco markers in black, at a known location on the build bed. those should be easy to detect and work with for extrinsic calibration.

as for intrinsic calibration (i.e. just the camera), the regular chess board stuff.

the “why” is still unclear. _why_ do you need what you need? if you think you’re done explaining, imagine me asking “why” again. children do that because it leads to information, because adults are notoriously incapable of making sense. do you perhaps try to monitor build progress, and detect errors, by comparing a view of the result with the STL model? I hate having to generate hypotheses.
