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

 
 

bug #52959: [octave forge] (image) histeq is not compatible with Matlab

Submitter:  None
Submitted:  Tue 23 Jan 2018 05:58:57 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 30 Jan 2018 10:51:34 PM UTC, comment #5: 

Thank you for the work around.

Anonymous
Sun 28 Jan 2018 09:21:21 PM UTC, comment #4: 

Checking again this bug report, indeed there is a problem of Matlab compatibility of histeq.
Thanks for reporting this.

Actually, there are few problems:

  • The output J should be in the same type as the input I. Now, even if I is uint8, J is double
  • Hist eq should support input image in types uint8, uint16, int16, single, or double.
  • There is an undocumented feature in Matlab: if histeq is called without argout, it displays (imshow) the output
  • Histeq can be called in matlab with J = histeq (I, hist) when is hist is a given histogram (input)
  • Histeq can be called in matlab with [J,T] = histeq (I) when is T is the calculated graylevel transformation (output)
  • Histeq can be called in matlab with map = histeq (I, oldmap)  to support an indexed image (I,oldmap)


Regarding the original report, a workaround can be:
J = histeq(grayimage16);
imshow(J);

A quick fix  for first 2 items, is to add the line
J = imcast(J, class(I))
Before endfunction.
A quick fix  for item 3, is to add the lines
If (nargout == 0)
 imshow(J)
end
 

Avinoam Kalma <avinoam>
Group Member
Sat 27 Jan 2018 05:07:04 PM UTC, comment #3: 

I will check the histeq issue, but pleay try
histeq(real(image))

Avinoam Kalma <avinoam>
Group Member
Wed 24 Jan 2018 08:39:39 PM UTC, comment #2: 

Hello
Thanks you have answered the second point, but I do not understand how this fixes the title of the bug.

Namely,
The histeq function is not returning results.
I had someone else try my code with matlab and it works. (See Fig 2 differences).

real(histeq(image))?
This does not make any changes. Am I misunderstanding?

Again thank you for the solution to the other issue. I had not searched for the bug as it was not my first concern. Maybe this was my fault for not making a bug report clear enough.


Anonymous
Wed 24 Jan 2018 06:04:34 PM UTC, comment #1: 

The problem is that  ifft(fft(x)) is not real for x real.
if you add real() in each fft you will get the rifht answers.

Closing as duplicate of bug #45932

Avinoam Kalma <avinoam>
Group Member
Tue 23 Jan 2018 05:58:57 PM UTC, original submission:  

Hello
I was using the image-2.6.1. Then updated to image-2.6.2 and received the same issues.

The histeq function is not returning results.
I had someone else try my code with matlab and it works. (See Fig 2 differences).

-----------------------------
Not sure if this should be another bug ticket
I am also having an issue with uint8?
I am receiving the following error:
error: invalid conversion from complex matrix to uint8

However, it could be the functions prior creating a complex matrix.

It does work on matlab (See Fig 9 differences)
I thought I would note the discrepancy,and maybe someone knows the issue.
-----------------------------

Note: I used https://savannah.gnu.org/patch/?func=detailitem&item_id=8722#options for impixelinfo (Andreas' version)

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #43036:  DIP.zip added by None (1MiB - application/zip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by avinoam (Posted a comment)
  •  

    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 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-26 mtmiller Releaseother dev
        Summary [octave forge] (image) histeq is not compatible with Matlab [octave forge] (image) histeq is not compatible with Matlab
    2018-07-02 jwe Summary [octave-forge] (image) histeq is not compatible with Matlab [octave forge] (image) histeq is not compatible with Matlab
    2018-01-28 avinoam Summary[Image Package] histeq is not compatible with Matlab [octave-forge] (image) histeq is not compatible with Matlab
    2018-01-28 avinoam StatusDuplicate Confirmed
        Open/ClosedClosed Open
        Release4.2.1 other
        Summary[Image Package] histeq not returning results. [Image Package] histeq is not compatible with Matlab
        Carbon-Copy- Added hardy
        Carbon-Copy- Added carandraug
    2018-01-24 avinoam StatusNone Duplicate
        Open/ClosedOpen Closed
    2018-01-23 None Attached File- Added DIP.zip, #43036

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code