0

I am showing an image so the user can select different ORI with the shape of rectangles always. My problem is that when I see the results of getPosition it gives me an x, y, width and height strange because if I use these numbers to extract this region I get another one totally different. Furthermore, they are too little to mark the current roi selected.

I think that the problem is because when I show the image Matlab reduces it to 67% because it says it is too big to show it so I think it's getting coordinates in a reduced image. Is there any way to get the real positions without this scale? I tried to divide these numbers by 0,67 but the result was not ok so I think matlab is not reducing the same in height than in width.

Learning from masters
  • 2,032
  • 3
  • 29
  • 42

1 Answers1

0

ok here is the crazy answer:

matlab x == y of your image

matbab y == x of your image

No matter with the scale.

Learning from masters
  • 2,032
  • 3
  • 29
  • 42
  • 1
    I was about to write that lol. Be careful with certain image processing functions. `x` and `y` are interchanged depending on which one you use. It's very important that you read the documentation before using a function. – rayryeng Aug 31 '15 at 15:39
  • If you read http://es.mathworks.com/help/images/ref/imroi.html and http://es.mathworks.com/help/images/ref/imrect.html?searchHighlight=imrect (which was what I found) you have the sensation that getPosition will return [xmin ymin width height]. Anyway, thank you for your suggestion. – Learning from masters Aug 31 '15 at 15:42