...
Patches flow
FrameProc
Defect Patch requests
PatchGrab
generate_XYPatInfo_2(
// returns xyInfo
PatchConsolidation
Partial defect patch buffers
stitchPatches()
Complete Defect Patches
across Frames
procCompositeChannelSingleDetectionAlgo
generateCompositedDefectPatchInfo
voCompleteLpdPatchInfo;
voCompleteExtendedPatchInfo;
voPatchRequests; // partial patch requests
complete defect patches
oCompositorHelper.Serialize_OutputsCompositorBufferAndGetPatchBuf()
// This serializes patch information and gets putch buffer for complete patches
Defect and XY Patch Buffers
FillPatch(pInData, voPairCompletePatchesLPD, "CompletePatchesLPD");
FillPatch(pInData, voPairCompletePatchesExtended, "CompletePatchesExtended");
CpatchExtractor::extract (...)
// extract() - extracting complete defect patches
and available XY partial patches
Defect Patch Requests
Output
1
2
3
CpatchExtractor::extract(..)
Output
{ } // calculate corner polar coordinates
//Accumulate patches per channel from all different compute nodes(inputs)
vectorRef_frame_to_patch.push_back(frame_to_patch);
vec_sPatchDesc.push_back(pPatchRequestResult->AvailablePatches->nFrames[nK]);
Defect Patch components and functional diagram combined
...
Drawing Igor Polkovnikov
Defect Patch Flow
Defect Patch Flow
AssignCompositeChDefectsPatchIdsAlgo (
ConverDefectSourceToDefectPatchSource (
CreateCompositeChPatchInfoAlgo (
CompletePatchInfoAlgo (
genNeighorHoodFrames_partialPatches (
PartialPatchInfoAlgo (
1
2
3
4
6
point_size_2_frame ()
finding patch indexes
aw::FrameNumDeltaPredictor(
(UINT32)uNumFrameRows, uPxlOverlapTop, dRadiusUm, dPxlSizeTngntlUm,
deltaFrameNum);
DOUBLE delta = (DOUBLE)( uNumFrameRows - uPxlOverlapTop ) * dPxlSizeTngntlUm;
DOUBLE deltafrev = (2.0 * dPi * dRadiusUm/delta) + dPxlSizeTngntlUm;
deltaFrameNum=(UINT32)( floor( deltafrev ) );
NOTE: This function is a first version of the code.
It is messy, long, and not optimal. The better version of almost the same functionality
is developed for NeedsMerge flow: generateDefectPatchRequestInfo(...)
// some data conversions
patHelper.addLpdDefects_PatchIDs(uLpds,
patHelper.addLpdDefects_PatchInfo
CxyCorrectionReversal::calculateRowAndColumnIndex (dPatchCenterX,
5
print_voDcPatchInfo(v);
// debug-prints all patch vectors if needed
// generates partial patch requests voPatcheRequests
This function is 170 lines of code.
SxyPatchInfo xyPatInfo(sP.dXUm, sP.dYUm, IgNS::DistBtwCenters(sP.uPatchSizeTngntl,dPxlSizeTngntlUm), IgNS::DistBtwCenters(sP.uPatchSizeRdl,dPxlSizeRdlUm) );
{
// this constructor calculates corner Polar coordinates of a full patch with:
// Note that dPatchSizeTngntlUm is a distance between centers of the corner pixels.
IgNS::rtw2RectPoint2 ( patchXY, dRadiusUm, dThetaRadian, dPatchSizeTngntlUm/2.0, dPatchSizeRdlUm/2.0 );
IgNS::rXY2rPolar ( patchRT, patchXY );
} // calculates patchRT
1
2
4
3
aw::assign_PachID(
sDefectPatchGeometry defectPatGeorm; // this structure is passed along patch requests. It describes a patch in global polar and cartezian coordinates.
defectPatGeorm.fXMicron = sP.dXUm;
defectPatGeorm.fYMicron = sP.dYUm;
defectPatGeorm.fHeightMicron = IgNS::DistBtwCenters ( sP.uPatchSizeTngntl , dPxlSizeTngntlUm );
defectPatGeorm.fWidthMicron = IgNS::DistBtwCenters ( sP.uPatchSizeRdl , dPxlSizeRdlUm );
defectPatGeorm.uPatchSizeRdl = sP.uPatchSizeRdl;
defectPatGeorm.uPatchSizeTngntl = sP.uPatchSizeTngntl;
defectPatGeorm.rFullPatchRadiTheta = xyPatInfo.patchRT;
sDefectPatchGeometry defectPatGeorm
//Finds indexes of the neighboring frames.
neighbor prediction.
voPartialLpdPatchInfo, voPartialExtendedPatchInfo
voLpdPatchInfo[i].voDcPatchInfo[j].bCompletePatch
voCompleteLpdPatchInfo,
voCompleteExtendedPatchInfo
patHelper.addLpdDefects_PatchInfo
GrabPatchRowCol_StartEnd2(
...
Calculate parameters of the patch
for a physical defect found
Analyse if a defect patch fits
within the current frame
Find global patch indexes
for the current defect. They can be negative
Is this a partial patch or a full patch?
Prepare partial patch requests
Global defect patch geometry prepared.
Partial patches will be extracted and stitched
in accordance with this.
Predict neighbour frames
Serialize partial defect patch requests
Extract and save complete patches
Calculate polar coordinates of
a defect patch corners
1
2
3
Based on the current frame radius dRadius,
a number of frames in one revolution
deltaFrameNum is found.
Then, idexes of the neighbouring frames
are found by incrementing, decrementing,
and adding-subtracting deltaFrameNum
to the current frame number based on
proximity of a defect to certain frame borders.
Three tangentially sequential frames are
choosen for the neighboring revolutions
Somewhere either in FrameProc or PatchGrab,
partial defect patch requests are anylized and
requested frame images are saved. Ask Dhruba
PatchGrab performs calculations
per frame per channel
Recorded frame buffers
auto funcCalculateXYLocation = getFuncCalculateXYLocation(
// obtains a function to calculate XY location for a frame pixel belonging to a certain channel
defectPatchGeometry
For every patch request, check
if the current frame contains
at least one full patch corner
CxyCorrectionReversal::calculateRowAndColumnIndex (
IgNS::normalize2Max_RectInt
Make sure that for any number of corners,
1,2,3 or 4, the index area of the partial patch
within the frame is rectangular and
includes all available corners.
Index area will always be larger-or-equal than
the area suggested by
the full defect patch geometry.
GrabPatchRowCol_StartEnd2 (
// if all 4 corners are inside, use older function
Calculate partial patch corners polar coordinates.
It will be used later in stitching. Update requests
with it.
Save patch indexes which serve to calculate size
Extract partial patches and save them
see Pat2Flow_XYPatchFlow diagram for description of this function
Need to replace with generate_XYPatInfo_3,
generate_XYPatInfo_3() produced an error, ask Dhruba.
It is unknown if the same error will be produced by _2()
Buffer is allocated in accordace with calculated indexes
map_channel_to_grabbedPatchess
map_channel_to_sPatchDescriptor_partialPatches
per very channel
calculateWithInternalMean()
calculateEnclosedEnergy()
// calculate some statistics
sP.nFrameNumber=CompleteLpdsInfo.nFrameNum;
sP.PatchIndex=CompleteLpdsInfo.uWithinFrameDefectNum;
create
Update
has
create
has
has
this is the keyword