Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

extract rotatted rectangle c#

Hi Kumi

 

I'm not familiar with NI vision under C#, so I will just give you the steps I would take:

  1. Extract the whole bounding rectangle of your rotated rectangle
  2. Do a bitmap rotation according to the angle of the rotated rectangle. You have to use the inverse angle to make the bitmap oriented in the right direction.
  3. Extract the center part of the rotated bitmap. The size of this part is equal to the dimensions of the original rotated rectangle

I can give you some code in LabVIEW if you can read it.

 

Vladimir


View my profile on LinkedIn
0 Kudos
Message 11 of 13
(1,703 Views)

Hi Vladimir,

 

this is exactly the problem I have, but I need to do it in LabView. Do you have code that does this? I'm having troubles cutting the right size out after the rotation.

 

Thanks,

Georg Fantner

0 Kudos
Message 12 of 13
(1,648 Views)

Hi Georg

 

Sorry to reply so late, I was too busy to do the example. Here you are.

 

Vladimir


View my profile on LinkedIn
0 Kudos
Message 13 of 13
(1,598 Views)