Hi all, i’m trying to solve an image analysis problem using a shader and just wondered if anyone here knew a way to solve it.
The problem is this : i have a binary image such that there are ‘blobs’ of various sizes which will be white and the background will be black in my texture and what i am trying to do is use a shader to identify the bounding box of each of the ‘blobs’ of white writing the bounding box of the ‘blobs’ into the RGBA channels of each pixel within each ‘blob’.
Anyone know a quick way of doing this ? currently i am trying to render the ‘blobs’ texture to a 2nd texture that just has the blob outlines then using the blob outline texture i’m trying to use a shader to trace the outlines of the blobs and write the max/min x and y texture coordinates into a new texture but its proving fairly difficult to get to work …
So is this problem solvable or should i just give up ? i was hoping the speed of a shader would out perform the current way i generate bounding boxs for the blobs (which is going through the whole data set labeling connected pixels to grow their bounding boxs)
Comments/suggestions welcome
Regards
Matt