PDF

Image to Curve
Introduction
The Image to Curve add-in lets you use an image as a starting point for an analysis. An interpolation curve is created from a contour plot of an imported image. This interpolation curve can then be used as part of a geometry. The figure below shows a swept mesh based on an image of an I beam. In this case the 3D model was created by extruding the image-based 2D solid geometry.
Add-in Library path: COMSOL_Multiphysics/image_to_curve
Image to Curve
Toolbar
Use the toolbar at the top of the Settings window for navigating between the different steps.
Click Browse to load a new image file. Plot renders the original imported image without any filter. Filter renders the filtered image using the Filter specified in the Image section. Contour plots image contours using threshold settings from the Contour section. Curve creates an Interpolation Curve node in a 2D Geometry sequence or a 3D Work Plane. The curve interpolation tolerance can be adjusted in the Curve section. Reset resets all values to factory settings.
Image
To import an image, in the Image section of the Settings window for the add-in, click the Browse button. This opens a file browser where you can select an image for import.
After import, the Image section will display information on the image size in pixels (x size and y size), the Image width in terms of the current length unit as determined by the Geometry node, the Filename, and the Filter used to process the image. Clearing the check box for Positive image will create a negative image.
By changing the Image width value you can adjust the dimensions of the final geometry. This could also be changed later by adding a Scale feature node to the Geometry sequence.
The Filter options include a few image processing filters including blur and sharpening filters.
Use these filters to reduce noise (blur), enhance edges (sharpen), or create new edges in the imported image. Changing the filter will change the shape of the curve extracted from the image. The default is a Gaussian blur filter. If needed, use a dedicated image processing software to further process the image before import.
Click the Plot or Filter button in the toolbar to render the original or filtered image, respectively.
Contour
By default, contour curves are automatically placed relative to an approximate average threshold level with respect to the pixel intensity level in the filtered image. To manually control the Contour threshold, clear the Automatic contour threshold check box.
Click the Contour button in the toolbar to visualize the contour curves and image.
To inspect the pixel values, in the Image to Curve Plot Group, select the Surface node, and click in the Graphics window. The pixel values and coordinates are displayed in an Evaluation 2D table.
Curve
Click the Curve button in the toolbar to generate an Interpolation Curve node in a 2D Geometry sequence or a 3D Work Plane. By default, the Curve type is set to Open but you can change this to Closed or Solid. The Curve tolerance setting determines how closely the curve should approximate the contour curves.
Target
In the Target section, you can specify the Geometry sequence for which the Interpolation Curve node should be created. You can specify the model Component and, in the 3D case, you can also specify the Work Plane.
Advanced
In the Advanced section, you can change the Interpolation method used to visualize the image. Select between Linear and Nearest neighbor interpolation. The Refinement per pixel setting determines the number of grid cells per pixel used to represent the image. A value lower than 1.0 means the grid used to represent the image has fewer interpolation points than the number of pixels in the image. A value greater than 1.0 means that the grid will oversample the image.
The Show x and y measures check box controls visualization of the dimensions of the contour curves.