comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Negative values with incrementation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Negative values with incrementation [message #70943] Thu, 20 May 2010 17:06
Suguru Amakubo is currently offline  Suguru Amakubo
Messages: 24
Registered: March 2010
Junior Member
Hi I am currently scattering points on a 400x400 image in order to use
them as reference points to manipulate subsets of images. During the
process I tried to establish the number of points scattered across the
image to see if any point is not covered by it.

When I was trying to evaluate the number of blank points on an image I
used incrementation to count the number of 'voids' in the scatter
pattern with a value of 0.

First time round, it gave me a positive number of void as expected and
I increased the number of points scattered however when I have done so
the number of void became negative.

below is the code:

void_point = 0
for count_x_axis = 0,size_of_image-1 do begin
for count_y_axis = 0,size_of_image-1 do begin
if coverage(count_x_axis,count_y_axis) eq 0 then void_point++
if void_point eq 0 then stop ; this test line was skipped and the
code stopped on the following stop
endfor
endfor
stop

coverage is a 400x400 matrice containing the number of reference
points scattered on a certain pixel.

and the output was:

IDL> print, void_point
-2469

the number of points scattered was 3015 (checked using help)

Any idea why this happens?

Thanks and apologies in advance if this is a trivial mistake.

Suguru
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Why do I get the string in ytitle in vertical direction
Next Topic: Checking my work: PERCENTILES.PRO

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 20:05:26 PDT 2025

Total time taken to generate the page: 0.22500 seconds