How to read a single pixel value from cops?

   1084   3   4
User Avatar
Member
267 posts
Joined:
Online
Anyone knows if the
tex/texni/pic/picni
expressions are working with copernicus?

I'm trying to read a single pixel from a Statistics COP and use that value on a parameter.
Edited by galagast - June 6, 2025 04:13:10

Attachments:
bItyP9c4DU.png (55.5 KB)

User Avatar
Member
106 posts
Joined:
Offline
I second this question! I've tried to create spare inputs on other nodes and reference those with expressions, but no luck. So what is the correct way to use the statistics node?
Thanks

Dag
User Avatar
Member
5 posts
Joined: July 2017
Offline
Hey, I faced the same situation today so I wrote a simple openCL snippet to remap it using the min and max value from the Statistics COP.

#bind layer src float
#bind layer layerMin float
#bind layer layerMax float
#bind layer !&remapped

@KERNEL
{
    float norm = (@src - @layerMin) / (@layerMax - @layerMin);
    @remapped.set(norm);
}

Just need to plug your source, your min then your max layer in the openCL COP after setting the binds.
Hope that helps!
Cheers
Edited by tbattistetti - Oct. 3, 2025 23:02:13
User Avatar
Staff
102 posts
Joined: Jan. 2024
Offline
https://www.sidefx.com/forum/topic/102699/?page=1#post-452013 [www.sidefx.com]

Here's another thread with a bit more explanation on this
  • Quick Links