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

 
 

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

Submitter:  Carnë Draug <carandraug>
Submitted:  Sun 17 Feb 2013 05:09:57 PM UTC
   
 
Category:  Octave Package Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  None
Originator Name:  Russell Haley Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 30 Sep 2018 11:43:04 AM UTC, comment #4: 
Avinoam Kalma <avinoam>
Group Member
Sat 29 Sep 2018 04:00:36 PM UTC, comment #3: 

I have pushed 8963435fce4d which checks whether input is class single instead of always converting to double for all real input.

This is a lot of code duplication and macros. This should probably be cleaned up with templates, but oh well.

Carnë Draug <carandraug>
Group Member
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>
Group 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.

http://sourceforge.net/p/octave/feature-requests/44/

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>:

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.

-------------- 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>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-29 carandraug StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-08-13 jwe Summaryimage package: _spatial_filtering_() always returns class double [octave forge] (image) _spatial_filtering_() always returns class double
    2013-02-19 carandraug Severity3 - Normal 2 - Minor
    2013-02-17 carandraug Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code