Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a70cb67
update C wrapper for windows
stedra-apryse Jun 10, 2026
8660b09
update readme
stedra-apryse Jun 10, 2026
7b12de4
downgrade to cmake 3.10
stedra-apryse Jun 10, 2026
93c8b65
C project readme updated for Windows
stedra-apryse Jun 11, 2026
3b9640c
remove mentions of wget
stedra-apryse Jun 11, 2026
464ce1f
Add document enhancement feature and update examples to v9.0
yurii-scanbot Jun 18, 2026
9bfd17c
Remove document classification feature and update usage examples acro…
yurii-scanbot Jun 19, 2026
dffd403
Update SDK version to 0.900.6 in CI workflow and test scripts
yurii-scanbot Jun 19, 2026
a7955f5
Update examples and tests to include 'enhance' command and improve er…
yurii-scanbot Jun 19, 2026
0aaa3a3
Update usage examples to remove '--save' option from 'enhance' command
yurii-scanbot Jun 19, 2026
117c484
include the result in the try-with-resources heade
yurii-scanbot Jun 19, 2026
cf6a31e
removed deprecated property usage for DocumentQualityAnalyzerResult
yurii-scanbot Jun 22, 2026
4c61051
Increase Node.js command timeout in CI tests
Copilot Jun 22, 2026
7968990
Use node 22
aleksei-scanbot Jun 22, 2026
5ebd3b7
Refactor document quality analysis by removing document found checks …
yurii-scanbot Jun 22, 2026
ad9c549
Update .gitignore to include .vscode/ and remove settings.json
yurii-scanbot Jun 22, 2026
da094c9
Update Libraries.txt for SDK version 9.0.0 and update magic_enum copy…
yurii-scanbot Jul 6, 2026
041faf1
Update version to 9.0.0 and documentation
yurii-scanbot Jul 6, 2026
030c868
Initial Dockerfile
aleksei-scanbot Jul 29, 2026
1d2e33d
Initial dockerfile
aleksei-scanbot Jul 29, 2026
0406ad5
Initial ps1 scripts
aleksei-scanbot Jul 29, 2026
e5056c5
Move linux scripts
aleksei-scanbot Jul 29, 2026
0998562
Update c tests
aleksei-scanbot Jul 29, 2026
9438256
java related fixes
aleksei-scanbot Jul 31, 2026
95cdd0c
Fix after review
aleksei-scanbot Aug 10, 2026
e45c3cd
Refactor document enhancement and camera handling functions
yurii-scanbot Aug 11, 2026
4982a69
install opencv
aleksei-scanbot Aug 12, 2026
52531ea
Merge pull request #32 from doo/ai/windwons-run
aleksei-scanbot Aug 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/run-tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ on:

# Global environment variables
env:
SDK_VERSION: '0.810.7'
SDK_VERSION: '9.0.0'

jobs:
test-x86_64:
Expand All @@ -58,10 +58,11 @@ jobs:
- name: Build Docker image (x86_64)
run: |
docker build \
-f test-scripts/linux/Dockerfile \
--build-arg SDK_VERSION=${{ inputs.sdk_version || env.SDK_VERSION }} \
--build-arg ARCH=linux-x86_64 \
--build-arg SCANBOT_LICENSE="${{ secrets.SCANBOT_LICENSE_KEY }}" \
--target all-tests \
--target sdk-verification \
-t scanbot-linux-x86_64:latest .

# Run the test suite with secure stdin approach
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ examples/nodejs/node_modules
examples/java/libs/*.jar
get-pip.py
.env
.venv
.venv
.vscode/
6 changes: 3 additions & 3 deletions Libraries.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Open Source libraries used in the Scanbot Linux SDK version 8.1.0:
Open Source libraries used in the Scanbot Linux SDK version 9.0.0:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Expand Down Expand Up @@ -1784,12 +1784,12 @@ defined by AIM ITS/04-023 International Technical Standard - Extended Channel In

magic-enum

Version v0.8.1
Version v0.9.7
(https://github.com/Neargye/magic_enum)

MIT License

Copyright (c) 2019 - 2022 Daniil Goncharov
Copyright (c) 2019 - 2024 Daniil Goncharov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 13 additions & 5 deletions examples/c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
# 3.10 is the version shipped with Ubuntu 18.04, which is the base of NVIDIA JetPack 4.6.
cmake_minimum_required(VERSION 3.10)
project(scanbotsdk_c_example C)
set(CMAKE_C_STANDARD 99)

# Find or download Scanbot SDK
if(NOT SCANBOTSDK_VERSION)
message(FATAL_ERROR "SCANBOTSDK_VERSION is not set.")
set(SCANBOTSDK_VERSION "9.0.0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we merge the PR only after v9 release is published?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we're not in a hurry to merge

endif()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
set(SCANBOTSDK_DIR "${CMAKE_CURRENT_BINARY_DIR}/scanbotsdk")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
find_package(ScanbotSDK REQUIRED)

file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
file(GLOB_RECURSE SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c")
add_executable(scanbotsdk_example ${SOURCE_FILES})
target_include_directories(scanbotsdk_example PRIVATE include)
target_link_libraries(scanbotsdk_example PRIVATE scanbotsdk)
target_link_libraries(scanbotsdk_example PRIVATE ScanbotSDK::ScanbotSDK)

if(WIN32)
add_custom_command(TARGET scanbotsdk_example POST_BUILD
Comment thread
kyrylo-volkov-apryse marked this conversation as resolved.
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"$<TARGET_FILE:ScanbotSDK::ScanbotSDK>"
"$<TARGET_FILE_DIR:scanbotsdk_example>"
)
endif()

63 changes: 45 additions & 18 deletions examples/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

> Scanbot SDK requires Jetpack 6.1, CUDA 12.6 and TensorRT 10.3 to run with GPU acceleration.

* Install a C compiler, CMake and wget:
* Install a C compiler and CMake:

```bash
sudo apt install -y cmake build-essential wget
sudo apt install -y cmake build-essential
```

* Optionally, install CUDA and TensorRT for GPU acceleration. Make sure that you're running a supported Jetpack version.
Expand All @@ -29,48 +29,75 @@ sudo jetson_clocks --restore

* You're now ready to run the examples.

----

### Raspberry Pi OS, Ubuntu, Debian

* Install a C compiler, CMake and wget:
* Install a C compiler and CMake:

```bash
sudo apt install -y cmake build-essential wget
sudo apt install -y cmake build-essential
```

* You're now ready to build the examples.

### Windows

Requirements:

* Visual Studio C++ Build Tools
* CMake 3.10+
* Recommended: ninja

## Building the Examples

In order to build all examples, run the following commands:

```bash
mkdir build
cd build
# Replace `<SCANBOTSDK_VERSION>` with the actual version number of the SDK you want to install.
cmake -DSCANBOTSDK_VERSION=<SCANBOTSDK_VERSION> ..
make
```
* With ninja (recommended):
```bash
mkdir build
cd build
# Replace `<SCANBOTSDK_VERSION>` with the actual version number of the SDK you want to install.
cmake -GNinja -DSCANBOTSDK_VERSION=<SCANBOTSDK_VERSION> ..
ninja
```

* With make:

```bash
mkdir build
cd build
# Replace `<SCANBOTSDK_VERSION>` with the actual version number of the SDK you want to install.
cmake -DSCANBOTSDK_VERSION=<SCANBOTSDK_VERSION> ..
make
```

* With MS Visual Studio (Windows-only):

```powershell
mkdir build
cd build
# Replace `<SCANBOTSDK_VERSION>` with the actual version number of the SDK you want to install.
cmake "-DSCANBOTSDK_VERSION=<SCANBOTSDK_VERSION>" ..
msbuild scanbotsdk_c_example.sln
# scanbotsdk_example.exe will be created under Debug\
```


## Usage
The example supports four modes: **scan**, **analyze**, **classify**, and **parse**.
The example supports five modes: **scan**, **analyze**, **enhance**, **parse**, and **live**.
```bash
./scanbotsdk_example scan <subcommand> --file <path/to/file.jpg> [--license <KEY>]
./scanbotsdk_example scan <subcommand> --file <path/to/file.jpg> [--license <KEY>]
./scanbotsdk_example analyze <subcommand> --file <path/to/file.jpg> [--save <out.jpg>] [--license <KEY>]
./scanbotsdk_example analyze <subcommand> --file <path/to/file.jpg> [--save <out.jpg>] [--license <KEY>]
./scanbotsdk_example classify <subcommand> --file <path/to/file.jpg> [--license <KEY>]
./scanbotsdk_example enhance <subcommand> --file <path/to/file.jpg> [--license <KEY>]
./scanbotsdk_example parse <subcommand> --text "<input>" [--license <KEY>]
./scanbotsdk_example live <subcommand> --file <path/to/file.jpg> [--license <KEY>] [--use_tensorrt]

```

## Example
```bash
./scanbotsdk_example scan barcode --file images/example.jpg --license <KEY>
./scanbotsdk_example analyze analyze_multi_page --file files/doc.pdf --license <KEY>
./scanbotsdk_example analyze crop_analyze --file images/doc.jpg --save out/crop.jpg --license <KEY>
./scanbotsdk_example enhance document --file images/doc.jpg --license <KEY>
./scanbotsdk_example parse mrz --text "P<UTOERIKSSON<<ANNA<MARIA<<<<<<" --license <KEY>
./scanbotsdk_example live barcode --file images/example.jpg --license <KEY>
```
Expand Down
17 changes: 17 additions & 0 deletions examples/c/cmake/Download.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Download.cmake
if(NOT URL OR NOT DEST)
message(FATAL_ERROR "Both URL and DEST variables must be defined.")
endif()

file(DOWNLOAD "${URL}" "${DEST}"
STATUS status
TLS_VERIFY ON
)

list(GET status 0 status_code)
list(GET status 1 status_string)

if(NOT status_code EQUAL 0)
file(REMOVE "${DEST}")
message(FATAL_ERROR "Download failed (${status_code}): ${status_string}")
endif()
114 changes: 87 additions & 27 deletions examples/c/cmake/FindScanbotSDK.cmake
Original file line number Diff line number Diff line change
@@ -1,47 +1,107 @@
include(ExternalProject)
include(FindPackageHandleStandardArgs)

if(NOT SCANBOTSDK_DIR)
message(FATAL_ERROR "SCANBOTSDK_DIR not set")
if(TARGET ScanbotSDK::ScanbotSDK)
return()
endif()

if (NOT EXISTS ${SCANBOTSDK_DIR})
if(NOT DEFINED SCANBOTSDK_VERSION)
message(FATAL_ERROR "SCANBOTSDK_VERSION is not set.")
endif()

if(NOT DEFINED SCANBOTSDK_DIR)
set(SCANBOTSDK_DIR "${CMAKE_CURRENT_BINARY_DIR}")
endif()

if(NOT EXISTS "${SCANBOTSDK_DIR}/scanbotsdk")
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(SCANBOTSDK_TARGET "windows-x86")
else()
set(SCANBOTSDK_TARGET "windows-x64")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(CMAKE_SYSTEM_PROCESSOR MATCHES ".*arm.*" OR CMAKE_SYSTEM_PROCESSOR MATCHES ".*aarch64.*")
set(SCANBOTSDK_TARGET "linux-aarch64")
else()
set(SCANBOTSDK_TARGET "linux-x86_64")
endif()
else()
message(FATAL_ERROR "System ${CMAKE_SYSTEM_NAME} not supported")
endif()

find_program(WGET_PATH wget REQUIRED)
set(_archive "${SCANBOTSDK_DIR}/scanbotsdk-${SCANBOTSDK_VERSION}-${SCANBOTSDK_TARGET}.tar.gz")
Comment thread
kyrylo-volkov-apryse marked this conversation as resolved.
set(_url "https://github.com/doo/scanbot-sdk-example-linux/releases/download/standalone-sdk%2Fv${SCANBOTSDK_VERSION}/scanbotsdk-${SCANBOTSDK_VERSION}-${SCANBOTSDK_TARGET}.tar.gz")

message(STATUS "Downloading ScanbotSDK ${SCANBOTSDK_VERSION} to ${SCANBOTSDK_DIR}")
file(MAKE_DIRECTORY "${SCANBOTSDK_DIR}")

if ("${CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES ".*arm.*" OR "${CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES ".*aarch64.*")
set(SCANBOTSDK_ARCHITECTURE "aarch64")
else ()
set(SCANBOTSDK_ARCHITECTURE "x86_64")
endif ()
string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}-${SCANBOTSDK_ARCHITECTURE}" PLATFORM_ID)
set(URL "https://github.com/doo/scanbot-sdk-example-linux/releases/download/standalone-sdk%2Fv${SCANBOTSDK_VERSION}/scanbotsdk-${SCANBOTSDK_VERSION}-linux-${SCANBOTSDK_ARCHITECTURE}.tar.gz")
execute_process(
COMMAND ${WGET_PATH} "${URL}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND "${CMAKE_COMMAND}"
"-DURL=${_url}"
"-DDEST=${_archive}"
-P "${CMAKE_CURRENT_LIST_DIR}/Download.cmake"
RESULT_VARIABLE _rc
)
if(NOT _rc EQUAL 0)
file(REMOVE "${_archive}")
message(FATAL_ERROR "Failed to download Scanbot SDK from ${_url}")
endif()

execute_process(
COMMAND tar -xf scanbotsdk-${SCANBOTSDK_VERSION}-${PLATFORM_ID}.tar.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND "${CMAKE_COMMAND}" -E tar -xf "${_archive}"
WORKING_DIRECTORY "${SCANBOTSDK_DIR}"
RESULT_VARIABLE _rc
)
if(NOT _rc EQUAL 0)
file(REMOVE "${_archive}")
file(REMOVE_RECURSE "${SCANBOTSDK_DIR}/scanbotsdk")
message(FATAL_ERROR "Failed to extract Scanbot SDK archive ${_archive}")
endif()

file(REMOVE "${_archive}")
endif()

find_library(ScanbotSDK_LIBS
NAMES libscanbotsdk.so
HINTS ${SCANBOTSDK_DIR}/lib/
)
NAMES scanbotsdk
PATHS "${SCANBOTSDK_DIR}/scanbotsdk/lib"
NO_DEFAULT_PATH
)

find_path(ScanbotSDK_INCLUDE_DIRS
NAMES ScanbotSDK.h
HINTS ${SCANBOTSDK_DIR}/include/)
PATHS "${SCANBOTSDK_DIR}/scanbotsdk/include"
NO_DEFAULT_PATH
)

set(SCANBOTSDK_REQUIRED_VARS ScanbotSDK_LIBS ScanbotSDK_INCLUDE_DIRS)

if(WIN32)
find_file(ScanbotSDK_DLL
NAMES scanbotsdk.dll
PATHS "${SCANBOTSDK_DIR}/scanbotsdk/lib"
NO_DEFAULT_PATH
)
list(APPEND SCANBOTSDK_REQUIRED_VARS ScanbotSDK_DLL)
endif()

find_package_handle_standard_args(ScanbotSDK
REQUIRED_VARS ScanbotSDK_LIBS ScanbotSDK_INCLUDE_DIRS)
REQUIRED_VARS ${SCANBOTSDK_REQUIRED_VARS}
VERSION_VAR SCANBOTSDK_VERSION
)

message(STATUS "Scanbot SDK third-party licenses are located at: ${SCANBOTSDK_DIR}/scanbotsdk/licenses/Libraries.txt")

add_library(scanbotsdk SHARED IMPORTED)
set_target_properties(scanbotsdk PROPERTIES
IMPORTED_LOCATION "${ScanbotSDK_LIBS}"
INTERFACE_INCLUDE_DIRECTORIES "${ScanbotSDK_INCLUDE_DIRS}"
)
add_library(ScanbotSDK::ScanbotSDK SHARED IMPORTED)
set_target_properties(ScanbotSDK::ScanbotSDK PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ScanbotSDK_INCLUDE_DIRS}"
)

if(WIN32)
set_target_properties(ScanbotSDK::ScanbotSDK PROPERTIES
IMPORTED_LOCATION "${ScanbotSDK_DLL}"
IMPORTED_IMPLIB "${ScanbotSDK_LIBS}"
)
else()
set_target_properties(ScanbotSDK::ScanbotSDK PROPERTIES
IMPORTED_LOCATION "${ScanbotSDK_LIBS}"
)
endif()
8 changes: 0 additions & 8 deletions examples/c/include/snippets/document/document_classifier.h

This file was deleted.

8 changes: 8 additions & 0 deletions examples/c/include/snippets/enhancer/document_enhancer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef DOCUMENT_ENHANCER_H
#define DOCUMENT_ENHANCER_H

#include <ScanbotSDK.h>

scanbotsdk_error_code_t enhance_document(scanbotsdk_image_t *image);

#endif
6 changes: 3 additions & 3 deletions examples/c/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <snippets/document/detect_document.h>
#include <snippets/document/analyze_multi_page.h>
#include <snippets/document/crop_and_analyze.h>
#include <snippets/document/document_classifier.h>
#include <snippets/enhancer/document_enhancer.h>

#include <snippets/live/live_barcode.h>

Expand Down Expand Up @@ -69,13 +69,13 @@ int main(int argc, char *argv[]) {
else if (strcmp(command, "vin") == 0) ec = detect_vin(image);
else { print_usage(argv[0]); ec = SCANBOTSDK_ERROR_INVALID_ARGUMENT; }
}
else if (strcmp(category, "classify") == 0) {
else if (strcmp(category, "enhance") == 0) {
if (!file_path) { print_usage(argv[0]); ec = SCANBOTSDK_ERROR_INVALID_ARGUMENT; goto cleanup; }

ec = load_image_from_path(file_path, &image);
if (ec != SCANBOTSDK_OK) goto cleanup;

if (strcmp(command, "document") == 0) ec = classify_document(image);
if (strcmp(command, "document") == 0) ec = enhance_document(image);
else { print_usage(argv[0]); ec = SCANBOTSDK_ERROR_INVALID_ARGUMENT; }
}
else if (strcmp(category, "analyze") == 0) {
Expand Down
Loading