
In the python sample for InitLineIterator here: Copied below for convenience:
>>> import cv
>>> img = cv.LoadImageM("building.jpg", cv.CV_LOAD_IMAGE_COLOR)
>>> li = cv.InitLineIterator(img, (100, 100), (125, 150))
>>> red_sum = 0
>>> green_sum = 0
>>> blue_sum = 0
>>> for (r, g, b) in li:
... red_sum += r
... green_sum += g
... blue_sum += b
>>> print red_sum, green_sum, blue_sum
10935.0 9496.0 7946.0
Is there a way to also get the pixel positon?
Originally posted by Marrok on ROS Answers with karma: 38 on 2011-06-04
Post score: 0