Image antyaliasing or something else to get best regionprops orientation?

1 Ansicht (letzte 30 Tage)
Like in topic. I show you what my problem concerns. I know that regionprops is one of the eaziest way to get orientation. Also We can get image moments methods etc.
Square graphically generated vs square puzzle with real photo from the camera (after sharpening imsharpen). What do you think, would you like to do some anti-aliasing to improve the orientation of this figure? With triangles, I do not have such a big bad offset, and with a square it even reached the value of 15 degrees.

Antworten (1)

Image Analyst
Image Analyst am 5 Feb. 2018
I don't understand. Are you saying that square is tilted 5.3558 or 15 degrees and you want to straighten it? Or are you seeking to do something else? Like smooth the sides or something. And what do you want to do after that? Perhaps smoothing or straightening is not even necessary to do what follows - I don't know because you have not told us.
Also, I would expect the orientation from regionprops() to be very unstable when measuring a square, for obvious reasons. Don't you agree? It could be virtually anything between 0 and 360 degrees depending on the noise.
  2 Kommentare
Damian
Damian am 5 Feb. 2018
Bearbeitet: Damian am 5 Feb. 2018
I want to get more accurate results because I will capture this value to robot with rotating suction cup. Program consists of straightening the puzzle to a specific orientation based on the current one (taken from the photo). I want to graphically improve the figure so that it is close to the ideal square. A moment ago I managed to get better results by 4 degrees using strel and imopen.
My square have code sentence that makes him a sqare (max_Ecc=0.3), and OrientationAngle = rad2deg(atan(-sides(2)/sides(1))) (minus' sign compensates for the inverted y-values in image coordinates)
Sorry i am not good in vision, i am try to understand it, please be pacient for me :)
Image Analyst
Image Analyst am 6 Feb. 2018
Like I said regionprops will be unstable with orientation. It takes the blob and fits it to an ellipse and finds the angle of the major axis. Since you have roughly a square, the fit ellipse will be very nearly circular. And what is the angle of a circle? Well if the circle/ellipse is just very slightly noisy, the slightly oblong circle could points in a drastically different direction. Drastically. I think a radon transform would be a better method. Luckily for you, I already have a program to rotate a blob using the radon transform. I've attached it.
Even if imopen did flatten out the sides of the square, you still have the problem that the direction of a circle is undefined. Just a slight perturbation will create a direction in some angle, but a different slight perturbation will cause a totally different angle.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by