bugGNU Octave - Bugs: bug #46528, A(I): index out of bounds...

 
 

bug #46528: A(I): index out of bounds triggered.

Submitter:  andrefou <andreff92>
Submitted:  Wed 25 Nov 2015 11:03:01 AM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Andre F Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 25 Nov 2015 01:44:07 PM UTC, comment #5: 

Thank you for all of these informations, I will create another post
more simple.

regards,
Andre Fougeront

andrefou <andreff92>
Wed 25 Nov 2015 01:18:08 PM UTC, comment #4: 

And if you want to reopen this bug, with a self-contained example that shows the behaviour, you can comment here and someone will reopen it. There is no need to open another bug.

Carnë Draug <carandraug>
Group Member
Wed 25 Nov 2015 01:12:29 PM UTC, comment #3: 

This is the Octave bug tracker. It is not a place to request help for your code. Please use the Octave help mailing list for such things. If you believe this is an Octave bug, please create a simple case that shows it. As it stands, yours is a request to debug your code and this is not the place for that.

Closing as invalid.

Carnë Draug <carandraug>
Group Member
Wed 25 Nov 2015 01:03:49 PM UTC, comment #2: 

Sorry I didn't gave all the babu function code I thought it was the end of it, I hope you'll still be able to help. Indeed there is a value to return in the end of the script.The complete babou code is :

function Quality=babu(img)
im=imread(img);

if length(size(im))>2
y=rgb2gray(im);
else
y=im;
end
[M N] = size(y);

f_len=8;  % Filter Length
th=35;    % Threshold for blocky edges.
ActTh=0.15; % Threshold for Activity

% Filters used
%background activity filter Horizontal and Vertical
fah=[1 -1 1 -1 1 -1 1 -1;zeros(1,8);-1 1 -1 1 -1 1 -1 1]./8;
fav=fah.';
%Low pass filter
ff=[1 0 1;0 0 0;1 0 1];
ff=ff/sum(sum(ff));
% prewitt H and V filter
PrH=[1 1 1;0 0 0;-1 -1 -1]./3;
PrV=PrH.';
%background luminance first result
yl=filter2(ff,y);
% background activity filtlered image H & V
yah=abs(filter2(fah,y));yah=yah./max(max(yah));
yav=abs(filter2(fav,y));yav=yav./max(max(yav));

% edge map H & V
difV=abs(filter2(PrV,y));
difH=abs(filter2(PrH,y));

% Activity Masking Weights with threshold
ActWV=double(~im2bw(yav,ActTh));
ActWH=double(~im2bw(yah,ActTh));
% Luminance Masking Weights

% HVS model 1) for 0-127 -> x/128 background luminance final result
%           2) for 128-255-> 1
LMW=sqrt(abs(yl/128).*double(~im2bw(yl/255,0.5))+im2bw(yl/255,0.5));
% Final Wts for Hzl and Vertical
TWV=LMW.*ActWH;
TWH=LMW.*ActWV;

% Remove the strong edges whose values are above th
% edgemap normalized H & V
Ilow=im2bw(difV/255,th/255);
MskH=double(~Ilow);
Ilow=im2bw(difH/255,th/255);
MskV=double(~Ilow);
%edge map intermediate result edge map normalized?
hisV1=sum(difV.*TWV.*MskV,1);
hisH1=sum(difH.*TWH.*MskH,2);
%median filtering with 1x8 blocks for V & H
%filtre moyenneur
%t=[1 40];%taille du filter
%H2 = fspecial('average',t);
%tv1 = imfilter(hisV1,H2);
%th1 = imfilter(hisH1,H2);
tv1=medfilt2(hisV1,[1,5]);
th1=medfilt2(hisH1,[5,1]);
%sum set to correspond for blockiness score
hisV=hisV1(8:8:end-8);
hisH=hisH1(8:8:end-8);
hisVa=tv1(8:8:end-8);
hisHa=th1(8:8:end-8);
%Quality retrieved from function created with both horizontal and vertical blockiness
Quality=(1-sqrt(sum(abs(hisV-hisVa))*8/N+sum(abs(hisH-hisHa)))*8/M)*10;
-------------------------

Anyway the issue is surely not due to  the script but on the loading, like the string input is not well readed.

Thank you,
Andre

andrefou <andreff92>
Wed 25 Nov 2015 11:37:57 AM UTC, comment #1: 

The problem with babu function is that you do not assign
any value to Quality.

so
A = babu("foo.jpg");

will fail.

Anonymous
Wed 25 Nov 2015 11:03:01 AM UTC, original submission:  

--------- follow up on
<http://savannah.gnu.org/bugs/?46455>


Sorry for not answering earlier.
I create a new ticket since this one is closed and don't see how to re-open it.
andrefou <andreff92>

Wed 25 Nov 2015 10:51:04 AM GMT, comment #3:

Here is the script herebelow,
The problem seems to be related to the function "babu" that I am using. When I use a string paameter to any function (can be "babu" or anything else), the problem occurs. Looks like a memory issue. Do you see anything wrong with what I am doing here.
I understand that in octave all function parameters are passed by value

I also tried
essai1=babu('/home/andre/clone/search-workers/image-processing/algo/set_of_images/testsethamed/Images/3.jpg');

----------------------------
function loaded = image_loader(s)
%let the user launch some matlab functions on the set of pictures realized by hamed

l={1;2;6;9;10;12;14;15;17;19;20;21;25;26;28;29;35;44;50;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71;72;73;74;75;76;77;78;79;80;81;82;83;84;85;86;87;88};

for i =1:51
a=l{[i,1]};
text=sprintf('/home/andre/clone/search-workers/image-processing/algo/set_of_images/testsethamed/Images/%d.jpg',a);
essai1=babu(text);
disp(essai1)
end
loaded=1;

-------------------------------
function Quality=babu(img)
im=imread(img);

if length(size(im))>2
y=rgb2gray(im);
else
y=im;
end
andrefou <andreff92>
Tue 24 Nov 2015 11:53:12 PM GMT, comment #2:

No response. Closing report.
Rik <rik5>
Project Administrator
Tue 17 Nov 2015 05:26:21 PM GMT, comment #1:

Can you upload the m-file you are using and the exact sequence at the command line that triggers the bug so that others can try to duplicate this. It's too vague right now for me to decide what is going on.
Rik <rik5>
Project Administrator
Mon 16 Nov 2015 10:57:08 AM GMT, original submission:

Hello,
My issue is linked with my build system, For some reason when I try on some function.m file
result=function('a String')
the function returns A(I): index out of bounds; value %% out of bound %%

But if the result do not depend on the input
result=function(a number)
would work and
result=function('a String')
wouldnt with the same error A(I): index out of bounds triggered.

Moreover, I can also avoid the error by changing the name of the function and function file by for example call the function function1 and then
result=function1('a String')
would work

So it is like my build is related to the issue and randomly create errors on some functions that take string in input(it could be some random function with random names). I reinstalled octave multiple time and it didn t change anything.
Any idea on what part of octave on an ubuntu system could be related to this kind of bug?
Thank you,
Andre Fougeront
andrefou <andreff92>

 

andrefou <andreff92>

 

(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 andreff92 (Submitted the item)
  • -email is unavailable- added by andreff92 (Andre F bug report on octave)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-25 carandraug StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2015-11-25 andreff92 Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code