bugGNU Octave - Bugs: bug #48942, Process image take long time

 
 

bug #48942: Process image take long time

Submitter:  Sasitha Iresh <sasithairesh>
Submitted:  Mon 29 Aug 2016 05:49:55 PM UTC
   
 
Category:  Performance Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Performance
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Sasitha Iresh Open/Closed:  * Closed
Release:  * 4.0.3 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 20 Sep 2016 08:38:13 AM UTC, comment #2: 

No response from sasithairesh for more than three weeks, closing as invalid.

Andreas Weber <andy1978>
Group Member
Mon 29 Aug 2016 06:28:06 PM UTC, comment #1: 

It is known that for loops are slow in Octave. You should vectorize your code (which is easy, there is no reason to use for loops here) or just use imadd from the image package:


pkg load image
c = imadd (a, b, "uint8");


Closing as invalid because this isn't a bug.

Andreas Weber <andy1978>
Group Member
Mon 29 Aug 2016 05:49:55 PM UTC, original submission:  

Processing image function .m files take minutes and full process in OS
while matlab do it in few seconds and lower processing power .

image processing function:

function img1= add_my(img1,img2)
    [m1,n1] = size(img1);
    [m2,n2] = size(img2);


    if m1==m2
        if n1==n2
            for i = 1:m1
               for j = 1:n1
                    img1(i,j) = img1(i,j)+img2(i,j);
                    if img1(i,j)>255
                        img1(i,j) = 255;
                    end
               end
            end
        end
    end

Sasitha Iresh <sasithairesh>

 

(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 andy1978 (Posted a comment)
  • -email is unavailable- added by sasithairesh (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-09-20 andy1978 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code