On 12/13/2012 04:23 AM, inshu chauhan wrote:
>>
>> if-else doesn't define a loop, but each of the for statements do.
>>
>> You have defined a classification for 8 of the possible colors, leaving
>> millions of them undefined. If the first time through the loop you
>> manage to hit one of those und
On 2012-12-13, inshu chauhan wrote:
> For this I put an else clause at end but is there a better way
> to avoid this kind of situation ??
An if-elif-else structure is usually broken if you leave out the
else part. When I don't expect it to ever actually happen when
the program is working correctl
On Thu, Dec 13, 2012 at 8:23 PM, inshu chauhan wrote:
>> Are you really getting floating point values, or are they always going
>> to be equal to an integer? Those if/elif statements might be a problem
>> if you ever need to compare to a value like (128.4, 255.0, 255.0).
>
>
> I dont have values
>
> if-else doesn't define a loop, but each of the for statements do.
>
> You have defined a classification for 8 of the possible colors, leaving
> millions of them undefined. If the first time through the loop you
> manage to hit one of those undefined ones, you'll have no value for
> classificat
Am 12.12.2012 16:00, schrieb inshu chauhan:
color = image[y,x]
if color == (0.0,0.0,0.0):
continue
else :
if color == (0.0,255.0,0.0):
classification = 1
elif color == (128.0, 0.0, 255.0):
classifi
On 12/12/2012 10:00 AM, inshu chauhan wrote:
> In this code :
>
> import cv
> g = open("PointCloudmitClass.txt", "w")
> image = cv.LoadImageM("Z:/modules/intensity_01.tif",
> cv.CV_LOAD_IMAGE_UNCHANGED)
> print image
> for y in xrange(0,image.height):
> for x in xrange(0,image.width):
>
On Thu, Dec 13, 2012 at 2:00 AM, inshu chauhan wrote:
> In this code :
>
> import cv
> if color == (0.0,255.0,0.0):
> classification = 1
> ...
> elif color == (255.0, 0.0, 255.0):
> classification = 7
>
> print >> g, x , y , color