Skip to content

Add .NET-specific OpenCvSharp guides - #2092

Merged
shimat merged 2 commits into
mainfrom
agent/add-dotnet-specific-guides
Jul 26, 2026
Merged

Add .NET-specific OpenCvSharp guides#2092
shimat merged 2 commits into
mainfrom
agent/add-dotnet-specific-guides

Conversation

@shimat

@shimat shimat commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Add three guides focused on behavior that is specific to OpenCvSharp and .NET: InputArray/OutputArray proxies and in-place processing, copy and native-memory ownership, and ASP.NET Core upload and stream integration.

The guides explain the current OpenCvSharp5 ref-struct proxy design, distinguish C# aliases from shared ROI views and deep copies, and provide bounded IFormFile/Stream examples with decoding, encoding, cancellation, concurrency, and headless deployment guidance. Navigation and related-guide links now expose the new material from the documentation landing pages.

Test plan

  • Compile representative OpenCvSharp and ASP.NET Core examples with 0 warnings and 0 errors
  • Check Markdown and TOC local links
  • Check code fences, UTF-8 encoding, and git diff --check

A full DocFX build was not run because DocFX is not installed in the local environment.

Summary by CodeRabbit

  • Documentation
    • Added new guides covering safe ASP.NET Core image handling for uploads/streams, including size validation, decoding/encoding error handling, cancellation, and guidance to return encoded data.
    • Added a guide explaining InputArray, OutputArray, and in-place processing, with lifetime and common pitfalls.
    • Added a performance/ownership guide for native memory, copies, and correct benchmarking practices.
    • Updated and expanded guide navigation and related links to make the new material easier to find.

@shimat shimat added the enhancement New feature or improvement to OpenCvSharp label Jul 26, 2026
@shimat shimat self-assigned this Jul 26, 2026
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bfddbaaf-4748-4b50-a0d6-b0234df80103

📥 Commits

Reviewing files that changed from the base of the PR and between b062cc7 and 4c2e934.

📒 Files selected for processing (2)
  • docs/docfx/articles/guides/aspnet-image-processing.md
  • docs/docfx/articles/guides/input-output-arrays-and-in-place.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/docfx/articles/guides/input-output-arrays-and-in-place.md
  • docs/docfx/articles/guides/aspnet-image-processing.md

📝 Walkthrough

Walkthrough

Three new guides cover array proxies, native-memory ownership and copying, and ASP.NET Core image processing. DocFX navigation and related-guide links expose the new content.

Changes

Documentation guides and navigation

Layer / File(s) Summary
Array proxy and in-place processing guide
docs/docfx/articles/guides/input-output-arrays-and-in-place.md
Documents array parameter roles, proxy lifetime constraints, output allocation, in-place processing, and common mistakes.
Native memory and copy behavior guide
docs/docfx/articles/guides/memory-copy-and-performance.md
Explains Mat ownership, aliasing, copying, reusable destinations, managed-memory views, stride handling, hidden copies, and benchmarking.
ASP.NET image processing guide
docs/docfx/articles/guides/aspnet-image-processing.md
Adds bounded stream decoding, image validation, controller processing, response encoding, cancellation, ownership, and deployment guidance.
Guide cross-links and navigation
docs/docfx/articles/index.md, docs/docfx/articles/toc.yml, docs/docfx/index.md, docs/docfx/articles/guides/*
Adds navigation entries and related-guide links for the new guides and ASP.NET image-processing content.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding several .NET-specific OpenCvSharp documentation guides.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/add-dotnet-specific-guides

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/docfx/articles/guides/aspnet-image-processing.md`:
- Around line 48-86: The try/catch around the image-processing flow currently
maps failures from Cv2.CvtColor and Cv2.ImEncode to HTTP 400. In the image
decode handler, limit OpenCVException translation to the Cv2.ImDecode
input/decode boundary, while allowing processing and encoding failures to
propagate to existing 5xx handling; preserve the existing invalid-image response
for decode errors.

In `@docs/docfx/articles/guides/input-output-arrays-and-in-place.md`:
- Line 57: Update the guidance in “InputArray.Create<T>” to explicitly document
that array/sequence overloads allocate a temporary array-backed Mat and pin the
managed input for the proxy lifetime, including the non-disposeable ref struct
behavior in OpenCvSharp5. Warn against using this pattern in hot loops and show
the existing explicit Mat ownership approach for repeated calls.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: af3cc19d-bc62-42b5-a2f0-54719bbd2a6a

📥 Commits

Reviewing files that changed from the base of the PR and between bf50d0e and b062cc7.

📒 Files selected for processing (9)
  • docs/docfx/articles/guides/aspnet-image-processing.md
  • docs/docfx/articles/guides/image-conversion.md
  • docs/docfx/articles/guides/input-output-arrays-and-in-place.md
  • docs/docfx/articles/guides/mat-basics.md
  • docs/docfx/articles/guides/memory-copy-and-performance.md
  • docs/docfx/articles/guides/resource-management.md
  • docs/docfx/articles/index.md
  • docs/docfx/articles/toc.yml
  • docs/docfx/index.md

Comment thread docs/docfx/articles/guides/aspnet-image-processing.md Outdated
Comment thread docs/docfx/articles/guides/input-output-arrays-and-in-place.md Outdated
@shimat
shimat merged commit 99e4b9b into main Jul 26, 2026
15 checks passed
@shimat
shimat deleted the agent/add-dotnet-specific-guides branch July 26, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to OpenCvSharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant