-
public class MorphAppComposite image processing operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interfaceMorphApp.TophatType
-
Field Summary
Fields Modifier and Type Field Description public final static intL_TOPHAT_WHITEpublic final static intL_TOPHAT_BLACKpublic final static intDEFAULT_WIDTHpublic final static intDEFAULT_HEIGHT
-
Method Summary
Modifier and Type Method Description static PixpixTophat(Pix pixs, int hsize, int vsize, int type)Performs a tophat transform. static PixpixFastTophatBlack(Pix pixs)Performs a tophat-like operation emphasizing small dark regions usingdefault values. static PixpixFastTophatWhite(Pix pixs)Performs a tophat-like operation emphasizing small bright regions usingdefault values. static PixpixFastTophat(Pix pixs, int xsize, int ysize, int type)Performs a tophat-like operation. -
-
Method Detail
-
pixTophat
static Pix pixTophat(Pix pixs, int hsize, int vsize, int type)
Performs a tophat transform.
Notes:
- Sel is a brick with all elements being hits
- If hsize = vsize = 1, returns an image with all 0 data.
- The L_TOPHAT_WHITE flag emphasizes small bright regions, whereasthe L_TOPHAT_BLACK flag emphasizes small dark regions. The L_TOPHAT_WHITEtophat can be accomplished by doing a L_TOPHAT_BLACK tophat on theinverse, or v.v.
- Parameters:
pixs- Source pix (8bpp)hsize- (of Sel; must be odd; origin implicitly in center)vsize- (ditto)type- L_TOPHAT_WHITE: image - opening or L_TOPHAT_BLACK: closing - image
-
pixFastTophatBlack
static Pix pixFastTophatBlack(Pix pixs)
Performs a tophat-like operation emphasizing small dark regions usingdefault values.
- Parameters:
pixs- Source pix (8bpp)
-
pixFastTophatWhite
static Pix pixFastTophatWhite(Pix pixs)
Performs a tophat-like operation emphasizing small bright regions usingdefault values.
- Parameters:
pixs- Source pix (8bpp)
-
pixFastTophat
static Pix pixFastTophat(Pix pixs, int xsize, int ysize, int type)
Performs a tophat-like operation.
Notes:
- Don't be fooled. This is NOT a tophat. It is a tophat-likeoperation, where the result is similar to what you'd get if you used anerosion instead of an opening, or a dilation instead of a closing.
- Instead of opening or closing at full resolution, it does a fastdownscale/minmax operation, then a quick small smoothing at low res, areplicative expansion of the "background" to full res, and finally aremoval of the background level from the input image. The smoothingstep may not be important.
- It does not remove noise as well as a tophat, but it is 5 to 10times faster. If you need the preciseness of the tophat, don't use this.
- The L_TOPHAT_WHITE flag emphasizes small bright regions, whereasthe L_TOPHAT_BLACK flag emphasizes small dark regions.
- Parameters:
pixs- Source pix (8bpp)xsize- width of max/min op, smoothing; any integer >= 1ysize- height of max/min op, smoothing; any integer >= 1type- L_TOPHAT_WHITE: image - min, or L_TOPHAT_BLACK: max - image
-
-
-
-