octave-maintainers
[Top][All Lists]
Advanced

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

Re: importing functions from image package to core


From: Daniel J Sebald
Subject: Re: importing functions from image package to core
Date: Mon, 15 Oct 2012 14:33:55 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 10/15/2012 02:01 PM, John W. Eaton wrote:
On 15-Oct-2012, Carnë Draug wrote:

| Hi
|
| there's a bunch of simple functions on the image package that I think
| could be moved to octave core (even though they used to belong to the
| matlab image processing toolbox). These are the isbw, isgray, isind
| and isrgb.
|
| The reason I propose the move is that some functions in core already
| perform this checks but have their own code.

Which functions do that?

| This functions are very
| simple and would cause very little maintenance issues while reducing
| repeated code.
|
| If no one objects, I can prepare a changeset with them.
|
| By the way, matlab removed this functions because of
| 
http://blogs.mathworks.com/steve/2007/03/09/what-happened-to-isgray-isind-isbw-and-isrgb/
| Not sure about the best approach there.

It seems like these functions are not really very useful.  So why
should we have them?  I'd vote for deprecating them instead of moving
them to core Octave.

Deprecate. As Carnë stated, these routines are very short, typically on the order of a couple conditional statements. So if the user really wants to implement the functionality of one of these, it's not a challenge.

The problem with these routines is that they impose a meaning on the data that simply can't be done generally. For example, "isbw" really means "is-the-data-0-or-1-only". Similarly "isrbg" really means "is-the-data-MxNx3". Etc.

If you feel these routines are often used and have general use, I'd propose coming up with different names that reflect what the routine is specifically testing. It seems to me the scenario is if the user loads an image (or data), not quite sure if it is 1 component, or 3 components. Otherwise, the user sort of needs to know the nature of the data before hand, i.e., black and white image, monochrome image, etc. If the data originates from some known image encoding standard, such information should be available from the encoding header.

Dan


reply via email to

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