help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

__spatial_filtering__() returns double precision results for single prec


From: Russell Haley
Subject: __spatial_filtering__() returns double precision results for single precision arguments
Date: Sat, 09 Feb 2013 19:23:08 -0600
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Hello,

I'm working on cleaning up images from a book photographing apparatus,
and I've been using some grayscale morphological filters.  These are
quite CPU intensive, taking some 40 seconds for a 5 megapixel image. I
recently gained access to a commercial scanner that produces 20
megapixel images.  I ran a benchmark with matrix multiplication, and
found that my machine is ~80% faster with single rather than double
precision, and therefore decided to switch to single precision.

Unfortunately, not only were the morphological filters not any faster,
they also returned double precision results.  As my structure element
was single precision, this caused the second operation to error out. I
tracked it down to __spatial_filtering__(), the compiled function
underneath ordfiltn().  Attached is a test case that demonstrates the issue.

Regardless of whether or not an implementation using single precision
internally would be faster, I don't think __spatial_filtering__() should
be returning results with different precision than the input.




Attachment: spatial_test.m
Description: Text Data

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]