Min/Max values of a COP
3404 2 0- Brian Walters
- Member
- 155 posts
- Joined: 9月 2015
- Offline
- Brian Walters
- Member
- 155 posts
- Joined: 9月 2015
- Offline
- symek
- Member
- 1390 posts
- Joined: 7月 2005
- Offline
You could use Image Chop [sidefx.com] and MathChop to get min/max values from an image or use Python and numpy:
but if the only objective is to check whether a channel is constant or not, you could use GradientCOP (normalize on), and ScaleCOP set to 2x2 pixels and point filter (or box would be saver?). You have 4 pixels in total. Any non constant image will have at least one pixel non-black. All black == image was constant.
node = hou.node("/img/comp1/file1") pixels = numpy.frombuffer(node).allPixelsAsString("C"), dtype=numpy.float32).reshape(node.xRes(), node.yRes(), 3).copy() pixels.min() pixels.max()
but if the only objective is to check whether a channel is constant or not, you could use GradientCOP (normalize on), and ScaleCOP set to 2x2 pixels and point filter (or box would be saver?). You have 4 pixels in total. Any non constant image will have at least one pixel non-black. All black == image was constant.
Edited by symek - 2016年8月30日 05:58:11
-
- Quick Links