DefectMap process (pre-release)

Carlos Milovic

Well-known member
Here is a pre-release of the DefectMap process, which will be included in the next PI Core distribution, as part of the ImageCalibration module. As the ImageCalibration process, DefectMap is released as an open source project, subject to the GPL.

Brief decription: This process allows the user to use a reference image (called "Defect Map") to indicate bad pixels on a target image. The Defect Map may be a grayscale or color image, where 0 values means "bad pixel" (gray values are used as scaling factor in convolution modes, see below). So, for "graphical reference" it needs to look like a inverted dark frame. Also, it is assumed that the Defect Map needs no further processing, it is ready to use. If you are using a dark frame, or other calibration frame as defect map, you may use any other process to modify it.
Besides from the Defect Map image selection, the user may choose between five operation methods: Mean, Gaussian Blur, Median, Minimum and Maximum. Those operations needs a structuring element, defined by the user following any of these geometries: Square, Circular, Row or Column. The size of the operation is automatically calculated for every bad pixel. Of course, no bad pixels are included in any of this calculations, regardless of the structuring element selected. Pixel values above 0 on the Defect Map act as a weight factor for the Mean and Gaussian blur operators.
Bayered images are not directly supported. Anyway, It is possible to modify/build the Defect Map in such a way that it uses pixels that corresponds to a certain color only.

Download links:

Source code:   http://pteam.pixinsight.com/pcldev/defectmap/DefectMap-src-20100504.zip
Windows 32bits: http://pteam.pixinsight.com/pcldev/defectmap/DefectMap-pxm-20100504_win_32.zip
Windows 64bits: http://pteam.pixinsight.com/pcldev/defectmap/DefectMap-pxm-20100504_win_64.zip
Linux 64bits: http://pteam.pixinsight.com/pcldev/defectmap/DefectMap-pxm-20100504_x11_64.tar.gz
(Will include 32bits releases if asked).


Feedback is appreciated :)
 
I suppose I should port my fixfits utility to PCL. Oy vay, the pain! :)

It finds the hot/cold pixels in a dark frame using a simple sigma limit. It also finds bad columns automatically and fixes both artifacts in raw mono and bayer images. As Juan would say "it works extremely well"  >:D

I haven't ported it to PCL because frankly it's a lot of work for not very much benefit. It's easy to just run the tool from the command line and generate fixed FITS files that can then be calibrated and stacked. Of course usage in PCL has benefits too but not for me :)

It is not open source but it's free. http://www.tungstentech.com/Software/FixFITS/tabid/78/Default.aspx
 
Maybe what I should do is incorporate my code in yours. That's probably faster than porting my code to PCL and hooking up all the variables and instances and callbacks and all that.
 
Which actually begs the question how we do source control on open source parts of PI? Do we have an SVN or CVS server? Should we start a sourceforge project for that?
 
Not sure what you mean by source control...
About "sharing" and updating the code, I was thinking on just attaching the changed files to a post in this thread, and then me, Juan, or other PTeam member, will upload it to the server and update the main links at the first post (at least, those with moderator capabilities).

You are highly welcome to jump in :) btw, I'm a big fan of the "divide and conquer" paradigm, so IMHO some features of your program may be best suited in other ad-hoc processes (like bad columns/pixel detection, for example... which is something I found very clever and usefull).
 
Ok, you're developing code but you don't know what source control is? That's dangerous :) How do you keep track of code revisions? Don't you use CVS or something like that in your work/play? If you and I were to work together on this module wouldn't you agree it's a good idea we know who made what change? That's what source control allows you to do.
 
I didn't say I was a good habits programmer :D

You are right. With the exception of Juan (who somehow understands my chaotic code ;) ) I've never worked with other people. We need a system to keep track to all of this... I think I'll have to educate myself into this topic :D
 
I'm a professional. I'll whip you into shape :)

At least tell me you keep backups in safe locations, please? Your code is gold my friend. Protect it.
 
Yes, of course. I keep zipped versions of the code for active projects on a specific pen drive. Also, I have a huge backup in one of my hard drives, with every code I ever wrote with the PCL.
 
Windows and Linux 64bits are not available
89382929.jpg
 
Back
Top