Syntax
IN=imofimsketch(I)
Input Parameter
I : | | Image of a scan or sketch of drawings or letters |
Output Parameter
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
- I: This is the input image, which can be a scan or sketch of drawings or letters. The image is expected to be in a format that can be processed by MATLAB's image processing functions.
Output Results
- IN: This is the output, which is the improved image after applying the binarization filter. The image is converted to a double precision array.
Algorithm Steps
- 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.
- 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.
- The result of the
imbinarize
function is converted to a double precision array and stored in the variable IN
.
- 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