imofimsketch

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Images
Introduced first in SolidGeometry 4.5, Creation date: 2019-02-10, Last change: 2025-09-14

uses an imbinarize filter to improve images before contourfind

Description

the filter was found in the matlab documentation

See Also: CPLofimage , imreadlastchanged

Example Illustration

 missing image of imofimsketch(I)

Syntax

IN=imofimsketch(I)

Input Parameter

I: Image of a scan or sketch of drawings or letters

Output Parameter

IN: improved image

Examples


imofimsketch(rgbsketch);




Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, imofimsketch, is designed to improve images, particularly scans or sketches of drawings or letters, by applying a binarization filter. The function is part of the SolidGeometry library and was introduced in version 4.5.

Input Parameters

Output Results

Algorithm Steps

  1. The function starts by applying the imbinarize function to the input image I. This function is used to convert the image to a binary image using adaptive thresholding.
  2. The parameters for imbinarize are set as follows:
    • Method: 'adaptive' - This specifies that adaptive thresholding is used, which calculates thresholds locally for different regions of the image.
    • ForegroundPolarity: 'dark' - This indicates that the foreground is darker than the background.
    • Sensitivity: 0.45 - This parameter adjusts the sensitivity of the thresholding. A lower value means less sensitivity to variations in lighting.
  3. The result of the imbinarize function is converted to a double precision array and stored in the variable IN.
  4. If the function is called without output arguments, it will display the original and processed images in a new figure window:
    • SGfigure is called to create a new figure window.
    • SGtitle is used to set the title of the window.
    • The original image I is displayed on the left side of the window using imshow with the title 'original image'.
    • The processed image IN is displayed on the right side of the window with the title 'imbinarize'.

This function is useful for preprocessing images to enhance their features before further analysis, such as contour finding.

Algorithm explaination created using ChatGPT on 2025-08-18 23:25. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21