File Access

With these tools, you can read information to or write information from a file:

Read from File

Read Region from File

Write Image to File

Write Region to File

Write to File

Common Use Cases

Use this overview to find the right tool to access files.

Task

Tool

Usage

Read text from a file.

Read from File

Read text from a file.

Reading modes:
  • Character

  • Word

  • Line

Write text to a file.

Write to File

Write text to a file, divided by a separator of your choice.

Writing modes:
  • Overwrite

  • Append

MERLIC will create a file to write to, if it does not exist already.

You can write any string result from a previous tools to a file or combine results and include custom text using the tool Evaluate Expression.

Read a region from a file.

Write a region to a file.

Write Region to File

Read Region from File

Read a region from a file or write it to a file. The used region format is .hobj HOBJ is a binary file format, which provides the functionality to write and read all kinds of iconic HALCON objects (images, regions, and XLDs). Since data are written with neither compression nor conversion, writing this file format is faster than other supported file formats in most circumstances. Hence, if an application needs to read and write all kinds of iconic HALCON objects as fast as possible and no compression is required, this format should be used. For images, all HALCON pixel types can be written. Multi-channel images are supported. The channels can have mixed pixel types but must have the same width and height. The domain of an image and its creation date are stored in the file as well. An object tuple is written into a single file. by default.

Write an image to a file.

Write Image to File

Write an image to a file in various formats, e.g., png, bmp, or jpeg.

To acquire images from files use the tool Acquire Image from File or Image Source.