plot integrated intensity profiles from image - java

asked 2017-11-20 10:24:25 -0500

EleDiam gravatar image

I have integrated my grayscale image using Imgproc.integral as follows:

Mat graySum = new Mat(); Imgproc.integral(grayImg, graySum, -1);

Is there any way to show the resulted output array: graySum as an integrated intensity profile where y: intensity(gray value) and x: distance(pixels)?

Any help is highly appreciated, EleDiam

edit retag flag offensive close merge delete

Comments

i don't think, this is feasible. can you take a look at the images here ?

what are you trying to do with the integral image ?

berak gravatar imageberak ( 2017-11-21 01:36:02 -0500 )edit

wait, can it be, you wanted something entirely else ? like the sum of the pixels over the x coords ?

berak gravatar imageberak ( 2017-11-21 01:43:21 -0500 )edit
1

What I want is to generate an intensity profile like this so that I can measure in the entire image the distance of a black track in the grayscale image. Yes instead of integration it can be the sum of the pixels along y.

EleDiam gravatar imageEleDiam ( 2017-11-21 01:49:07 -0500 )edit

helpful image ! but that's not an integral, but just the intensity along a line between 2 points.

if it was c++, you could use the LineIterator class (very easy), but java ? hmmm. probably need to reinvent your own bresenham line algorithm.

berak gravatar imageberak ( 2017-11-21 01:51:43 -0500 )edit

This could be a better example. In my case instead of getting the profile of the intensity along the line I would like to do it for the entire image. Probably is not something that could be done with java..

EleDiam gravatar imageEleDiam ( 2017-11-21 02:08:03 -0500 )edit

matlab, not helpful at all.

if you just want the pixels along the x or y axis, that would be a plain reduce

berak gravatar imageberak ( 2017-11-21 02:13:13 -0500 )edit

You were right this function can be helpful cause what I wanted after all was to convert my 2D image to 1D. Now I have to figure out how I could plot the output vector. Thanks a lot for your input!!

EleDiam gravatar imageEleDiam ( 2017-11-21 02:33:17 -0500 )edit