help-octave
[Top][All Lists]
Advanced

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

HELP :: if() problems encountered


From: shoker_17
Subject: HELP :: if() problems encountered
Date: Fri, 15 Sep 2006 08:22:58 -0700 (PDT)

Status            : Beginner

Version           : Octave 2.1.72
Purpose          : image Processing
Problem          : If () statement
Descriptions   : I was trying to manipulate a matrix in image intensity. The
main idea was to retrieve those data that were less than 1 from monoColor.

##to find the number of consecutive black pixels horizontally
##monoColor : image intensity of 32 rows and columns
for x = 1 : row
        for y = 1 : column
                if(monoColor(x,y) < 1)                 //tryin to find values 
in monoColor
less than 1
                        test(x,y)= monoColor(x, y);
                endif
          endfor
endfor

In the above code, i was trying to find the values in the matrix which are
less than 1.
However, to my dismay, I did not manage to get results i wanted. Instead, i
obtained the same number of rows and columns. Besides thism the values
smaller than 1 and 1 were also obtained. 

Maybe i used the syntax wrongly  else "<1" doesnt seems to work at all.
*weird*

=============some monoColor image intensity==================

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 1 1 1 1 0.992156862745098 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0.996078431372549 1 0.988235294117647 1 0.996078431372549 0.996078431372549
1
 0.988235294117647 1 1 1 1 1 0.988235294117647 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 0.996078431372549 1 0.992156862745098 1 0.988235294117647 1
0.996078431372549 0.996078431372549

=============some monoColor image intensity==================

=============corresponding values in test array=================

 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 0 0 0 0 0.992156862745098 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.996078431372549 0 0.988235294117647 0 0.996078431372549 0.996078431372549
0
 0.988235294117647 1 1 1 1 1 0.988235294117647 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 0.996078431372549 1 0.992156862745098 1 0.988235294117647 1
0.996078431372549 0.996078431372549

=============corresponding values in test array=================

H E L P !!

Shoker
-- 
View this message in context: 
http://www.nabble.com/HELP-%3A%3A-if%28%29-problems-encountered-tf2278226.html#a6327507
Sent from the Octave - General forum at Nabble.com.



reply via email to

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