Login  Register

Re: How to use line selection and count the number of specific colored pixels on either sides of the line?

Posted by Herbie on Jan 08, 2016; 6:28pm
URL: http://imagej.273.s1.nabble.com/How-to-use-line-selection-and-count-the-number-of-specific-colored-pixels-on-either-sides-of-the-lin-tp5015347p5015350.html

Dear Ram,

there are several solutions...

1. Use the polygon tool and select one of its sides like the separating
line and the others according to the image borders.
Count the pixels in this selection, then invert the selection and count
again.

2. Do the math, i.e. determine the co-ordinates of the separating line
and with them create the above polygon selection by a macro.

HTH

Herbie

::::::::::::::::::::::::::::::::::::::::
Am 08.01.16 um 16:03 schrieb ram prasad:

> Dear All,
>
> I would like to know how to do the following in imageJ.
>
> I'm trying to get the number of yellow and black coloured pixels on either
> sides of a line, which will be drawn by me using the line selection tool.
> I'm attaching one such image wherein I have drawn the line for your
> reference.
>
> I know how to how use the thresholder to get at the counts of yellow and
> black pixels in the whole image but I don't know how to go about this. I
> googled to see if anyone else had done something similar but the examples I
> found usually involved splitting the whole image into two equal halves
> based on the image dimensions. I don't think it is possible in my case as
> the coordinates of the line cannot be deduced from the image dimensions.
>
> I'd really appreciate it if you could let me know how to go about this or
> if you can suggest a different approach.
>
> Let me know if you need any more details from my side.
>
> Thank you very much.
>
> Cheers,
> Ram
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html