Author Topic: DefectMap module: wrong result  (Read 2773 times)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
DefectMap module: wrong result
« on: 2012 March 08 01:40:47 »
Hello.

There are wrong result in Minimum/Maximum Operation.

Look at DefectMapInstance.cpp code around Line#348
Code: [Select]
switch ( operation )
I think need to Sort pixels before switch ( operation ).
Otherwise, in case DMPOperation::Minimum:  f = pixels[0] is correspond to TopRight pixel which value can be not minimum value.

Just move code "pcl::Sort( pixels.Begin(), pixels.At( n ) );" from line#367 to line before "switch ( operation )".

Best regards,
Nikolay.

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: DefectMap module: wrong result
« Reply #1 on: 2012 March 08 05:43:00 »
One more bug:

Lines 341 and 343 code is checking for membership the pixel to the image.
Code: [Select]
if ( i >= 0 && i <= img.Width() )But, in fact, there is an error in the verification.
For example: if the image width = 100, pixels from 0 to 99.
A pixel with coordinate 100 is out of Image.
But the current code is not reject the pixel with coordinates 100.

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: DefectMap module: wrong result
« Reply #2 on: 2012 March 14 05:18:49 »
Thanks for pointing them! They should be fixed in the next update.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com