bugGNU Octave - Bugs: bug #38345, [octave forge] (image)...


bug #38345: [octave forge] (image) __spatial_filtering__() always returns class double

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Sun 17 Feb 2013 05:09:57 PM UTC  
Category: Octave Forge PackageSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Inaccurate Result
Status: ConfirmedAssigned to: None
Originator Name: Russell HaleyOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 19 Feb 2013 04:48:33 PM UTC, comment #2:

well, this was fixed on the functions that call _spatial_filtering_ but I still think you're right that it should be done by _spatial_filtering_ itself so I'll leave it as open.

Carnë Draug <carandraug>
Project Member
Sun 17 Feb 2013 05:46:27 PM UTC, comment #1:

The problem appears to have been fixed as part of the ongoing implementation of strel and seperable morphological filters.


The image package that was in the SVN repo on th 16th gives results with the proper types, though it appears that double precision is being used internally for any arguments for which is_real_matrix() returns true.

Russell Haley <rhaley>
Sun 17 Feb 2013 05:09:57 PM UTC, original submission:

Originally reported on the help mailing list by Russell Haley <rhaley@tamu.edu>:


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: spatial_test.m
Type: text/x-objcsrc
Size: 160 bytes
Desc: not available
URL: <http://mailman.cae.wisc.edu/pipermail/help-octave/attachments/20130209/914e66fe/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.cae.wisc.edu/pipermail/help-octave/attachments/20130209/914e66fe/attachment-0001.pgp>

Carnë Draug <carandraug>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by rhaley (Posted a comment)
  • -unavailable- added by carandraug (Submitted the item)
  • -unavailable- added by carandraug (original bug reporter)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 13 Aug 2017 01:26:26 PM UTCjweSummaryimage package: _spatial_filtering_() always returns class double=>[octave forge] (image) _spatial_filtering_() always returns class double
    Tue 19 Feb 2013 04:48:33 PM UTCcarandraugSeverity3 - Normal=>2 - Minor
    Sun 17 Feb 2013 05:09:57 PM UTCcarandraugCarbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1