selected region rounds to zero even when data is constant
I want to calculate the mean of the data contained in a circular ROI.
the test pattern is a ckeckerboard with squares of +1 and -1 as values.
each square consists of 16 pixel a side of either 1 or -1.
the average is done:
def update(roi):
img1b.
v1b.autoRange()
selected = roi.getArrayReg
print(
selected=[[0. 1. 1. 1. 0.]
[1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1.]
[0. 1. 1. 1. 0.]]
[0.6 1. 1. 1. 0.6] 4.90442528864582 4.90442528864582 339.88891144046164 182.1808594976158 0.0
though the ROI is100% in a region of value 1
where do the 0 values come from?
I learnt:
the zeroes are the intersection pixels, thus add only about the non zero pixel, hoping that zero value does not exist
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- pyqtgraph Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: