inpolygon, different results from MATLAB R2022a and R2023a?

4 Ansichten (letzte 30 Tage)
Junichiro Kawahara
Junichiro Kawahara am 12 Dez. 2023
Kommentiert: DGM am 13 Dez. 2023
aoi1_x = [0, 960];
aoi1_y = [0, 1080];
inpolygon(2, 2, aoi1_x, aoi1_y)
ans = logical
0
R2022a returns 1, but R2023a returns 0.
I would like to know why these results differ.
  6 Kommentare
Dyuman Joshi
Dyuman Joshi am 12 Dez. 2023
I disagree. It's frustrating to know that a well known* bug is not even acknowleged by TMW, nor is there any acknowlegment of the bug being fixed for the later versions.
And the fact that it is still not fixed for the versions mentioned, just adds onto the frustration.
* - I say well known because it appears across multiple versions.
Adam Danz
Adam Danz am 12 Dez. 2023
Bearbeitet: Adam Danz am 12 Dez. 2023
To confirm what others have mentioned above, this behavior was updated in R2022b.
A bug report was not published.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Cris LaPierre
Cris LaPierre am 12 Dez. 2023
This is not an official MathWorks answer.
My observation is the following. You used to be able to define a rectangular ROI by specifying just 2 diagonal vertices. However, this behavior was undocumented. All doc examples and wording indicate you should specify all vertices. Apparently around R2022b, changes were made to the function that no longer allow you to specify a rectangular ROI with just 2 points.
This example highlights the risk of using undocumented behavior - it can change at any time without notice.
  3 Kommentare
Matt J
Matt J am 13 Dez. 2023
@Junichiro Kawahara Please Accept-click Cris' answer, seeing as you are happy with it.
DGM
DGM am 13 Dez. 2023
Ah. I didn't even expect that to be a thing. That kind of makes the other bug report make more sense now.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by