Hello,
First: VIPS is a very nice package. And I can load in images and write them
back. But I don't understand how to use masks (VIMask etc.) in combination
with erode/dilate.
I tried for example the following:
---------------------------------------------
VImage fred( "testimage.tif" );
for( int i = 0; i < fredmask.xsize(); i++ )
for( int j = 0; j < fredmask.ysize(); j++ )
fredmask(i,j) = 128; // or 0 or 255
VImage out = fred.erode(fredmask);
out.write("testimageout.tif");
---------------------------------------------
I've read an image processing tutorial and about masks. Somehow you have to
create a binary-like mask (with 0's and 1's), but this is not exactly
allowed in the VIMask as I understand? Only 0, 128 or 255.
Anyway, whatever values I fill in in the mask, even when everything is
filled in with 0's and the center of the mask with value 128 or 255, it
looks like the whole output image has had a very heavy erode on it. Anyone
who can help me or explain how to erode an image with VIPS? Thought the
erode could be done in smaller steps...
See the attachment for the input and output images.
Thanks in advance!
|