-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pixelmask #3
Comments
Hi Max, Sounds good to me. Did you also propagate the bit convention to saveFrame.cpp (see line 401)? Best, On Mar 28, 2013, at 8:21 PM, Max Hantke wrote:
|
Hi Rick! |
Hi Max Masks are multiplied by the data to achieve masking effect. Is this compatible with a bit mask - where the integer value of the array is no longer 1 or 0? As I see it, when using a combined mask one would need additional logic operations to combine the different bits appropriately before applying the mask to the data. Is this really a good idea? Including the additional information is not a bad idea when saving the frames (this is done already) but it will necessitate a bunch of logical OR/AND/NOR operations whenever applying masks. Comments? A. On Mar 28, 2013, at 8:21 PM, Max Hantke [email protected] wrote:
|
Hi Anton! |
My feeling that it's bad practice to multiply the intensity data by the mask, though I often do that too. We should handle flagged pixels more explicitly - make the algorithms "aware" of the pixel-flagging convention. If my understanding of Max's convention is correct, then most algorithms would simply check if the corresponding pixel in the mask has a value of zero (all bits are zero), else the pixel is flagged for some reason and should be ignored. Rick On Mar 28, 2013, at 10:21 PM, Anton Barty wrote:
|
On Mar 28, 2013, at 10:46 PM, rkirian [email protected] wrote:
Ifs are generally bad practice in a loop - they cause problems with predictive branch execution, vectoring and pipelining - which slows down the code. It depends what one wants to do - the multiplication approach works where it works. Comparing not-zero-equals-bad is at least one operation, but can it be simplified to something more pipeline friendly. |
Yes, a pixel is "healthy" if the mask has a value of 0. |
OK - I'll have to look up the meaning of "predictive branch execution" now :) I'm just thinking of things like peakfinders, where there are loads of unavoidable if statements, and adding more seems negligible. But maybe this requires more thought than I realize. Rick On Mar 28, 2013, at 10:52 PM, Anton Barty wrote:
|
The way this is usually done is: // zero hot pixels from image which should be very CPU friendly as the bitwise and and comparison with zero can be done very efficiently in hardware. |
In my small example anton seems to be right: // bitmask.cpp double diffclock(clock_t clock1,clock_t clock2) int count_maskBit(int * maskBit) int count_mask0(int * mask0) int main() for(int i=0;i<L;i++){ begin=clock(); begin=clock(); return 0; hantke@gauguin: Pipelining seems to be difficult indeed for these bitwise operations. |
That's comparing one mask. But if you have to check two masks or more (which is often the problem we have) then when using multiple masks the time goes up linearly while with the bitwise approach it almost doesn't increase (unless you go above 32 masks). In any case I think the time is irrelevant as we can mask 10 billion elements in a few seconds. IO will be a bottleneck way before this ever becomes an issue. |
I pushed my current version to a new branch. Feel free to play! |
Hi! |
Hi Max we should think a little about development and testing branches before merging everything into master. When someone new clones the repository, they will start in the master branch. We should have a different branch for developers, which has the latest features for testing; this is where most of us will live most of the time. We could call this development branch 'developer' (for want of more creativity). Comments welcome Anton On 02/04/2013, at 2:45 PM, Max Hantke [email protected] wrote:
|
Hi Anton! |
Hi!
I united all masks to a static pixelmask (the same for all events) and a dynamic pixelmask (different for every event). They are 16 bit unsigned ints where every bit stands for a particular option defined in detectorObject.h. The set of options can be easily extended. Do you have any objections or remarks before merging?
I suggest the following convention:
/*
*/
static const uint16_t PIXEL_IS_PERFECT = 0; // Remember to change this value if necessary when adding a new option
static const uint16_t PIXEL_IS_INVALID = 1; // bit 0
static const uint16_t PIXEL_IS_SATURATED = 2; // bit 1
static const uint16_t PIXEL_IS_HOT = 4; // bit 2
static const uint16_t PIXEL_IS_DEAD = 8; // bit 3
static const uint16_t PIXEL_IS_SHADOWED = 16; // bit 4
static const uint16_t PIXEL_IS_IN_PEAKMASK = 32; // bit 5
static const uint16_t PIXEL_IS_TO_BE_IGNORED = 64; // bit 6
static const uint16_t PIXEL_IS_BAD = 128; // bit 7
static const uint16_t PIXEL_IS_OUT_OF_RESOLUTION_LIMITS = 256; // bit 8
Cheers,
max.
The text was updated successfully, but these errors were encountered: