Finding intensity of Vertical bars in a Image

Hey there,
I’m trying to find intensity of vertical bars at the center of each bar.
(ex.. Drawing a vertical line at the center of each bar and getting rgb values), below is the attached image on which i’m trying to achieve .

As you can see there are 5 Vertical Bars and i need to find intensity(getting RGB values) on those bars at the center of each bar.

I tried using canny edge detection and then findContours but it’s of no use.
Does anyone have any different approach to solve the problem.

Thank you!

You can try to sum over line and column and I hope you will find 5 regions

Hey Laurent,
Can you please elaborate it.

just read the pixel values? can you please show the code you have so far.

manually define the location (x coordinate) of your vertical lines along which you want to sample your picture.

Canny makes absolutely no sense here. none at all. do not use it. not even “just because”. it’s the wrong tool. it can’t be made to “work”.

Something like this

1 Like