Ask Your Question

Plot angle vs intensity histogram from image center

asked 2018-11-07 15:39:52 -0500

Basically I'm selecting a circular area in the image(gray scale DFT image) where image center coordinates are the center of the circle.I want to plot angle vs intensity variation for the area covered by this circle.My idea is to use a virtual line through image center with the length of circle diameter and move by 1 degree and sum up total pixel intensity values covered by that line.Similar approach is mentioned in below links,



I would like to know is it possible to achieve such a thing using OpenCV + python (It seems not that easy)? Or is there any other approach for plotting angle vs intensity histogram through image center?

I was initially thinking to get logPolar transform of the image and access angle and intensity values from it.But i was not sure whether it was a possible approach since i couldn't even interpret logPolar transform output in an informative manner.(It just returns logploar transformed image, not angle and log magnitude vectors from the image center)

Any suggestions would be appreciated...

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-11-08 01:06:20 -0500

berak gravatar image

opencv is a computer-vision library, and not really suitable for plotting.

also, logPolar / warpPolar seem to be the opposite of what you wanted.

there's phase(), magnitude(), polarToCart() to retrieve useful information, but in the end, this is not the appropriate library for your job (imho).

edit flag offensive delete link more



Thanks for the reply.Really appreciate it.But i like to clarify somethings in here.

I'm not really worrying about the plotting.It can be done using some other library.My concern is that, is it possible in OpenCV to access intensity values all the pixels of an image that make same angle (clockwise or counterclockwise) with the image center?

Seems in-built functions you have mentioned in here are not useful in my scenario since, 1. Angle is measured in these functions respected to the origin instead of center 2. I can't directly apply polar coordinates since my requirement is not depending on both angle and magnitude values.Instead it is only based on angle.

nick_leo gravatar imagenick_leo ( 2018-11-08 01:48:20 -0500 )edit

yea ;( it also seems, you're not even using opencv's dft (which is not "centered" by default)

the c++ api has a LineIterator class, which would allow you to traverse the radius for a given angle, and sample the underlying Mat (that's more or less, what your links there proposed, no ?, but not available in python.

berak gravatar imageberak ( 2018-11-08 02:04:02 -0500 )edit

Aboutsection I use this

For radial distribution I use this

LBerger gravatar imageLBerger ( 2018-11-08 03:04:11 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-11-07 15:38:09 -0500

Seen: 28 times

Last updated: Nov 08