There isn’t a ROI feature, but you can get a cropped info in a variable.
crop(_#ind,_x,_y,_z,_c,_dx,_dy,_dz,_dc,_boundary_conditions) returns a vector whose
values come from the cropped region of image [ind] (or from default image selected if
ind is not specified). Cropped region starts from point (x,y,z,c) and has a size of
dx x dy x dz x dc. Arguments for coordinates and sizes can be omitted if they are not
ambiguous (e.g. crop(#ind,x,y,dx,dy) is a valid invocation of this function).
If you want to crop for individual channels instead, then you do something like.
repeat $! l[$>]
#Insert the use of crop function in eval or fill block loop or a variable#
- s is the number of channels in a image.
- shared is directly accessing a channel by creating a linked layer. It’s not creating a new image.
- rm. removed the shared layer.
Here’s a real world example of crop usage
f. ">begin(const ww=abs($3);const hh=abs($4);const wwhh=ww*hh;const length=floor(w/ww);avg_a=vectorlength(0);avg_b=vectorlength(0);const avg_c="$avgc";const w_avg=wwhh*avg_c;const iw_avg=wwhh-w_avg;);
So, when x==0 and y%hh is equal to 0, this will execute a loop that is as long as the length. crop function are vectors containing the cropped area of image. Then add all of those vector into a sum. And insert it into a subvector.
Note that #-2 means second last image, v*ww the x-position of crop location, y means the y-position of crop location, and ww,hh is the size of crop.
As for color space conversion, you can do rgb2hsv. RGB255 is generally assuming the default. G’MIC doesn’t really have the concept of color space, so you’d actually have to do some math here.
As for your main question, can you show the before/after image? I believe it can be easily done. Along with information such as dimensions.