Imaging Processing and Analysis Library for COC40
EFFICIENCY Many functions automatically identify special cases, invoking code optimized for each special case. FLEXIBILITY PROGRAMMING For DSP programmers who expect faster execution of their programs, native routines are also provided. Native routines require a TMS320C40 compiler (or assembler) and are more efficient than bound routines. Many native routines can be combined into a single TMS320C40 program which only needs to be loaded once, eliminating the overhead required with bound routines. BOARD CONTROL |
ARITHMETIC Add, subtract, multiply, divide, and average two images. Add or multiply a single image by a constant. Select between 8 image subtraction options.
|
LOGICAL AND, OR, or XOR two image pairs or single images with a mask.
|
||||||||||||||||||||||||||||||||||||||||||
EDGE DETECTION
|
FILTERS
|
||||||||||||||||||||||||||||||||||||||||||
COPY, RESIZE, ROTATE Copy an image buffer into a specified buffer location, concurrently performing these operations:
SEQUENCE OPERATIONS
|
NORMALIZATIONS AND CORRECTIONS
|
||||||||||||||||||||||||||||||||||||||||||
PIXEL OPERATIONS
|
MORPHOLOGICAL OPERATIONS Morphological operations may be executed with the standard 3 x 3 structure element, or an arbitrary structure element may be defined.
|
||||||||||||||||||||||||||||||||||||||||||
CONVOLUTIONS
|
HISTOGRAM Compute histogram. Optionally obtain the following statistics:
|
||||||||||||||||||||||||||||||||||||||||||
DRAWING/ANNOTATION
|
CALIBRATIONS AND MEASUREMENTS
|
||||||||||||||||||||||||||||||||||||||||||
CENTER OF MASS Compute the center of mass and total mass for any full image or region of interest.
|
MOMENTS The following statistics are returned for moment computation. The statistics can be computed in pixel values or in calibrated units.
|
||||||||||||||||||||||||||||||||||||||||||
TRANSFORMS
|
|||||||||||||||||||||||||||||||||||||||||||
BLOB ANALYSIS Analyze image for blobs with or without holes. Define constraints on blob size. Optionally obtain the following statistics for each blob, computed in pixel values or in calibrated units.
|
TYPICAL EXECUTION SPEEDS These operations were performed using standard PXIPL-COC40 functions.
* Accuracy is dependent on image quality. |
Native TMS320C40 Functions
|
||
Requires TMS320C40 "C" compiler.
|
||
Add Pixels of Image Pair | De-Flicker Interlace: Modify Singularities | Map Ulong Pixel Values in Region |
AND Pixels in Region with Mask | Decode SMPTE Vertical Interval Time Code | Map Ulong Pixel Values |
AND Pixels of Image Pair | Difference for Insert of Image Pair | Map Ushort Pixel Values in Region |
AND Pixels with Mask | Dither Pixels, Normal | Map Ushort Pixel Values |
Average Image Sequence | Dither Pixels, Uniform | Medial Axis Thinning |
Average Pixels of Image Pair | Draw 2-D Cosine Product Pattern | Modify Region Definition: Rectangle to Polygon |
Calibrate Intensity/Density Mapping | Draw 2-D Gaussian Pattern | Morphology Close |
Calibrate Spatial Mapping | Draw 2-D Separable Patterns | Morphology Dilation w. 3x3 Element |
Complement Pixel Values in Region | Draw Alignment Pattern | Morphology Dilation |
Complement Pixel Values | Draw Arrow | Morphology Erosion w. 3x3 Element |
Compress Region Path | Draw Box | Morphology Erosion |
Compute Center of Mass of Region | Draw Curved Line defined as Bezier Polynomial | Morphology Hit-Miss |
Compute Center of Mass | Draw Ellipse | Morphology Open |
Compute Center of Mass, Binary Image Region | Draw Icon or Cursor | Normalize Columns' Mean |
Compute Center of Mass, Binary Image | Draw Icon Primitive, Free Resources | Normalize Image as per Background Image |
Compute Histogram on Region | Draw Icon Primitive, Initialize | Normalize Lines' Mean |
Compute Histogram on Region | Draw Icon Primitive, Modify Pixels | NxN Convolution, Integer |
Compute Histogram Statistics w. Interpretation | Draw Icon Primitive, Test Completion | NxN Convolution, Real |
Compute Histogram Statistics w. Interpretation | Draw Line Segment | NxN Dynamic Threshold |
Compute Histogram Statistics | Draw Region Boundary | NxN Inverse Contrast Ratio Mapping |
Compute Histogram Statistics | Draw Region Path | OR Pixels in Region with Mask |
Compute Histogram | Edge Detection, Kirsch | OR Pixels of Image Pair |
Compute Moments of Region w. Interpretation | Edge Detection, Roberts | OR Pixels with Mask |
Compute Moments of Region | Edge Detection, Sobel Absolute | Paint within Region |
Compute Moments w. Interpretation | Edge Detection, Sobel | Perform Intensity/Density Mapping |
Compute Moments | Edge Gradient, Thin | Perform Inverse Spatial Mapping |
Compute Shape Statistics of Image Region | Exclusive OR Pixels of Image Pair | Perform Spatial Mapping |
Compute Tabulated Histogram | Extend Region Path | Product of Pixels of Image Pair |
Construct PXIMAGE: Access Freq. Domain Complex Image | Extend Region Path | Ratio of Pixels of Image Pair |
Construct PXIMAGE: Access Image in Host Memory | Field Interlaced Image Line Shuffle | Release Intensity/Density Mapping State |
Construct PXIMAGE: Access Image in Malloc'ed Memory | Field Interlaced Image Line UnShuffle | Release Spatial Mapping State |
Construct PXIMAGE: Release Image in Malloc'ed Memory | Filter Frequency Domain | Scale Freq. Domain by Log Magnitude Plot |
Contrast Enhance By Percentile | Filter, Low Pass, Fixed | Scale Pixel Values in Region |
Contrast Enhance Region By Percentile | Filter, Low Pass, Low Smear | Scale Pixel Values |
Contrast Enhance Region | Filter, Low Pass, Weighted | Scan, Connect, Collect Region by Table |
Contrast Enhance | Filter, Median | Scan, Connect, Collect Region by Value |
Contrast Match Image Pair | Filter, Median, Binary Images | Search for Pixel by Table |
Copy & Area Interpolation | Filter, Median, Weighted | Search for Pixel by Value |
Copy & Bilinear Interpolation w. Orientation | Filter, Rank High (Dilate) | Set Pixel Values in Region |
Copy & Exchange Image Buffers | Filter, Rank Low (Erode) | Set Pixel Values |
Copy & Nearest Neighbor Interpolation w. Orientation | Filter, Sharpen, Laplacian | Shift Pixel Values in Region |
Copy & Skew Image Left/Right | Find Blobs and List | Shift Pixel Values |
Copy & Skew Image Up/Down | Find Blobs, Analyze and List | Spatial Intensity Normalization |
Copy & Spatial Replicate | Find Region's Enclosed Area | Spatial Quantization & Shrink |
Copy Buffer from Raw Image Address | Find Region's Enclosing Window | Subpixel Edge Measurement |
Copy Buffer to Raw Image Address | Follow and Collect Region Boundary by Value | Subtract Pixels of Image Pair |
Copy Image Buffer Region | Get Dimensions of Freq. Domain Representation | Swap Line or Column Pairs |
Copy Image Buffer with Reversal | Halftone by Black/White Sum | Threshold Pixel Values in Region |
Copy Image Buffer with Shift | Histogram Equalization | Threshold Pixel Values in Region |
Copy Image Buffer | Initialize Region Path | Threshold Pixel Values |
Copy Image with Rotation | Insert of Differences of Image Pair | Threshold Pixel Values |
Copy Image with Warping | Integrate Image Sequence | Transform Image: FFT |
Correct Image as per Speckle Mask | Line Pair Pixel Shuffle | Transform Image: Inverse FFT |
Correlation Profile | Line Pair Pixel UnShuffle | Translate Region Definition to Path |
Count Pixels by Threshold | Log Magnitude Plot of Freq. Domain | Translate Region Definition to Scan List |
Count Region Pixels by Threshold | Map Uchar Pixel Values in Region | XOR Pixels in Region with Mask |
De-Flicker Interlace: Line Pair Average | Map Uchar Pixel Values | XOR Pixels with Mask |
Bound TMS320C40 Functions
|
||
Requires only PC "C/C++" compiler.
|
||
Add Pixels of Image Pair | Edge Detection, Roberts | Histogram Equalization |
AND Pixels of Image Pair | Edge Detection, Sobel Absolute | Integrate Image Sequence |
Average Image Sequence | Edge Detection, Sobel | Log Magnitude Plot of Freq. Domain |
Average Pixels of Image Pair | Edge Gradient, Thin | Morphology Dilation w. 3x3 Element |
Compute Center of Mass | Exclusive OR Pixels of Image Pair | Morphology Erosion w. 3x3 Element |
Compute Center of Mass, Binary Image | Filter Frequency Domain | Normalize Image as per Background Image |
Compute Histogram | Filter, Low Pass, Fixed | NxN Convolution, Integer |
Compute Moments w. Interpretation | Filter, Low Pass, Low Smear | NxN Convolution, Real |
Compute Moments | Filter, Low Pass, Weighted | OR Pixels of Image Pair |
Compute Tabulated Histogram | Filter, Median | Product of Pixels of Image Pair |
Contrast Match Image Pair | Filter, Median, Binary Images | Ratio of Pixels of Image Pair |
Convert Freq. Domain to/from Host Format | Filter, Median, Weighted | Scale Freq. Domain by Log Magnitude Plot |
Copy & Bilinear Interpolation w. Orientation | Filter, Rank High (Dilate) | Spatial Intensity Normalization |
Copy & Nearest Neighbor Interpolation w. Orientation | Filter, Rank Low (Erode) | Subtract Pixels of Image Pair |
Copy Image with Rotation | Filter, Sharpen, Laplacian | Threshold Pixel Values |
Correlation Profile | Find and List Blobs* | Transform Image: FFT |
Count Pixels by Threshold | Get Dimensions of Freq. Domain Representation | Transform Image: Inverse FFT |
Edge Detection, Kirsch |
* Blob Analysis is supported only under 32 bit PC compilers
(Bound function).
DUAL PROCESSOR CONTROL -
PXIPL-COC40 functions allow for asynchronous operations on multiple TMS320C40
processors.
If two TMS320C40s are available, each function mentioned above can be directed to operate on either processor, with each processor accessing a separate 4MB section of image memory divided into buffers.
For example, with 24 image buffers, processor A can access buffers 1 thru
12 while processor B simultaneously accesses buffers 13 thru 24. Or, processor
A can be executing a program on buffers 1 thru 12 while processor B is digitizing
into buffers 13 thru 24.
4MOBJ SOFTWARE -
4MOBJ is a library which operates with PXIPL-COC40 to provide image acquisition,
display, and image access. 4MOBJ also includes TMS320C40 communication routines
for program loading, execution, and PC to/from TMS320C40 communication.
SAMPLE CODE -
Detailed sample code is provided to demonstrate various function calls.
The following example code demonstrates a typical PXIPL-COC40 program.
A background is subtracted from the image and a blob search is performed. The
Center of Mass of the first five blobs are printed on the 4MIP Debug Screen
(if in use), and also returned to the host PC program.
// Parameters passed by the host in the // communication buffer, and results returned. #define NBLOB 5 // number of blobs to search for struct parms_from_host { struct c40m4image image[1]; // host stored source image uint background; // host stored subtraction value uint threshold; // host stored threshold union { ulong c40; // floats returned already float pc; // converted to PC format } comx[NBLOB], comy[NBLOB]; // center of mass: x & y }; main() { struct parms_from_host *pp; struct pximage srcimage; struct pxy search; struct pxywindow size; struct pxip8blob results[NBLOB]; int n, i; // Pick up pointer to parameters from host PP = (struct parms_from_host*) c40m4_combufp; // Init the pximage structures expected by image processing // functions from the image description passed by the host, // selecting image buffer and area of interest. c40m4_setpximage(&srcimage, &PP->image); // Subtract background, in place pxip8_pixadd(NULL, &srcimage, &srcimage, PP>background, 2); search.x = -1; search.y = 0; // init search coordinates size.nw.x = 100; size.nw.y = 100; // min blob size: 100x100 size.se.x = 120; size.se.y = 130; // max blob size: 120x130 // Find first 5 blobs, segmented with pixel values greater // than the specified threshold, that meet the size constraint n = pxip8_bloblist(NULL, &srcimage, &search, 'g'^'t', PP>threshold, 0, &size, 0, NULL, NBLOBS, results, NULL); // Report c40m4_debugprintf("blobs found=%d\\n", n); for (i = 0; i < n; i++) { // Print results on 4MIP's debug screen (if in use) c40m4_debugprintf("blob:%d Center of Mass=%g,%g \\n", i, results[i].ucom.xd,results[i].ucom.yd); // Store results for host processor retreival PP->comx[i].c40 = c40toieee(results[i].ucom.xd); PP->comy[i].c40 = c40toieee(results[i].ucom.yd); } return(n); }
IMAGING BOARD:
For use with 4MOBJ and: 4MEG VIDEO Model 12 (Rev. 4.3 and higher) imaging board
and COC401 or COC402 processing boards.
ENVIRONMENT:
Memory requirements: Approximately 16 to 256 Kbytes, dependent upon selection
of library routines.
PXIPL-COC40 must be used with 4MOBJ software.
LICENSING:
Licensing permits royalty free inclusion of library routines into programs using
EPIX 4MEG VIDEO and COC40 series imaging boards.
SOFTWARE INCLUDES:
As required by the chosen environment:
Specifications and prices subject to change without notice.
EPIX® imaging products are made in the USA.
Copyright © 2024 EPIX, Inc. All rights reserved.