How can I resample an Image in Scikit?
Juan Nunez-Iglesias
jni.soma at gmail.com
Thu Apr 23 23:25:37 EDT 2015
Hey Claiborne,
You can use transform.rescale (instead of resize) to scale by a given factor. You can use order=0 to ensure a binary image. That will give you the zoomed-in blocks without the grayscale. To get smoothing, I would try one of two things:
- get the blocky image, then apply a binary closing with a disk of radius 2-4; or
- rescale with order>2 and then threshold the image to get a binary image again.
I'm not sure whether either of these will give you a nice enough result, though. But, give it a try!
On Fri, Apr 24, 2015 at 8:59 AM, Claiborne Morton
<claiborne.morton at gmail.com> wrote:
> Hey guys,
> I was wondering if there is a way to resample images in Scikit Image. Im
> not even sure that is the correct terminology for what I am trying to do?
> Basically my goal is to increase the size of images by a factor of 4. My
> goal is to smooth the edges of shapes within my images, by increasing the
> number of pixels. I have tried doing this using the resize function but I
> end up with the same rough edges, just on a larger scale. Also the images I
> am working with are binary, and I would like this to remain when the image
> is expanded. I have tried doing this using resize, but the result is an
> image with grayscale pixels, and the rough edges are only magnified. Some
> time in the past I was able to get these result using Fiji and Preview
> (mac), but am not exactly sure how. I have attached both a zoomed image of
> the resize function as well as a zoom on the results I have made in the
> past. Also attached is the images that I am trying to multiply by a factor
> of 4 (binary_filled_bp). Sorry for the confusing post. Please let me know
> if I can clear anything up!
> Thanks Clay
> --
> You received this message because you are subscribed to the Google Groups "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150423/60ff8562/attachment.html>
More information about the scikit-image
mailing list