From: Michael B. <mic...@gm...> - 2009-01-09 01:17:02
|
2009/1/7 Martin Desruisseaux wrote: > However the above involves a lot of images (up 6) because of intermediate steps. > Maybe this is not an issue. But if it is, you could also create your own JAI > operations doing all this work in one step. It also give you more control on > what is computed exactly. If you wish to do so, the first step would be to > create a subclass of javax.media.jai.AreaOpImage. > Hi Martin, I created a new operator, MaskedConvolveOpImage, together with associated factory, descriptor and spi classes. It is really just a hack of JAI's ConvolveOpImage where I've added an ROI to the constructor which is then queried (roi.contains method) when moving the kernel and processing kernel cells. It works very well :-) Along the way I learned more about JAI's use of ROI but it does seem to be quite limited. Basically, the ROI only affects statistical operators. An ROI can be attached as a property to an image but doesn't act as a mask for non-statistical image operations - rather it is just kept in synch with the image if possible (e.g. cropped, sub-sampled). This puzzles me a little because I would have thought there were many applications that would need selective processing of pixels based on threshold value, juxtaposition etc. Would the MaskedConvolve operator be a useful addition to the gt-coverage module ? Thanks again for your suggestion. Michael |