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

 
 

bug #66148: [octave forge] (image) Add imbinarize() function for replacement of im2bw() function

Submitter:  Yu Hongbo <yuhongbo>
Submitted:  Fri 30 Aug 2024 02:02:14 PM UTC
   
 
Category:  Octave Package Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Patch Submitted Assigned to:  avinoam
Originator Name:  Open/Closed:  * Open
Release:  * other Release: 
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 07 Apr 2025 08:45:22 PM UTC, comment #10: 

Attached an updated version of adaptthresh.m and a new function imbinarize.m.

Please review

(file #57113, file #57114)

Avinoam Kalma <avinoam>
Group Member
Wed 19 Mar 2025 05:52:49 AM UTC, comment #9: 

Please review: new function adaptthresh.m
(which will be used by imbinarize)

(file #57039)

Avinoam Kalma <avinoam>
Group Member
Mon 09 Sep 2024 08:24:13 PM UTC, comment #8: 

Yes, I'd also love to see an imbinarize function in the image package. But I haven't found the time to implement it myself in the last years, yet. And yes, please keep im2bw as well.

Hartmut <hardy>
Sat 31 Aug 2024 12:31:17 PM UTC, comment #7: 

Thanks. Of course

Avinoam Kalma <avinoam>
Group Member
Sat 31 Aug 2024 10:05:41 AM UTC, comment #6: 

I don't have anything to add. But when you add imbinarize please don't remove im2bw.

Carnë Draug <carandraug>
Group Member
Sat 31 Aug 2024 09:35:18 AM UTC, comment #5: 

Adding stakeholders

Avinoam Kalma <avinoam>
Group Member
Sat 31 Aug 2024 09:34:25 AM UTC, comment #4: 

imbinarize is a very useful function, and it is my to-do list for a long time.

I will write it (don't hold your breath, it will take some time)

Avinoam Kalma <avinoam>
Group Member
Sat 31 Aug 2024 07:13:16 AM UTC, comment #3: 


imbinarize() function has another restriction: the im has to be a grayscale image matrix, so the workaround is:

> function bw = imbinarize (im)
>   if (!isgray (im))
>       error('im should be grayscale image')
>   endif
>   threshold = graythresh (im);
>   bw = im2bw (im, threshold);
> endfunction

Yu Hongbo <yuhongbo>
Fri 30 Aug 2024 02:38:04 PM UTC, comment #2: 

e.g., does the following function produce the simplest expected output?


function bw = imbinarize (im)
  threshold = graythresh (im);
  bw = im2bw (im, threshold);
endfunction

Nicholas Jankowski <nrjank>
Group Member
Fri 30 Aug 2024 02:25:09 PM UTC, comment #1: 

the matlab help for im2bw suggests that


thresh = graythresh(I);
BW = im2bw(I,thresh);


is a workaround to emulate:

BW = imbinarize(I);


until a compatible imbinarize function is implemented.  Are there other imbinarize features you need immediately? it may be that other workarounds, or possibly even a placeholder wrapper function, could be implemented for those features.

Nicholas Jankowski <nrjank>
Group Member
Fri 30 Aug 2024 02:02:14 PM UTC, original submission:  

Matlab added imbinarize() function for replacement of im2bw() function, and im2bw() function is deprecated now.
In #66107, what I really need is imbinarize() function.

Yu Hongbo <yuhongbo>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #57113:  adaptthresh_V1.m added by avinoam (11KiB - application/octet-stream)
file #57114:  imbinarize_V0.m added by avinoam (9KiB - application/octet-stream)
file #57039:  ‏‏adaptthresh_V0.m added by avinoam (11KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by yuhongbo (Submitted the item)
  •  

    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
    2025-05-13 avinoam StatusIn Progress Patch Submitted
    2025-04-07 avinoam Attached File- Added adaptthresh_V1.m, #57113
        Attached File- Added imbinarize_V0.m, #57114
    2025-03-19 avinoam StatusConfirmed In Progress
    2025-03-19 avinoam Attached File- Added ‏‏adaptthresh_V0.m, #57039
    2024-08-31 avinoam Carbon-Copy- Added hardy
        Carbon-Copy- Added carandraug
    2024-08-31 avinoam StatusNone Confirmed
        Assigned toNone avinoam
    2024-08-30 nrjank CategoryOctave Function Octave Package
        Severity3 - Normal 1 - Wish
        Priority5 - Normal 3 - Low
        Releasedev other

    Back to the top

    Powered by Savane 3.15-64aa.
    Corresponding source code