8000 Improve stripe detector to reject texture false positives by Vivu-github · Pull Request #4 · Vivu-github/Algorithms · GitHub
[go: up one dir, main page]

Skip to content

Improve stripe detector to reject texture false positives - #4

Open
Vivu-github wants to merge 1 commit into
masterfrom
codex/modify-code-to-detect-only-periodic-stripes
Open

Vivu-github wants to merge 1 commit into
masterfrom
codex/modify-code-to-detect-only-periodic-stripes

Conversation

@Vivu-github
Copy link
Copy Markdown
Owner

Motivation

  • The original detector could mistake terrain/texture for periodic stripes, so the goal is to only report narrow-band, periodic stripe patterns and avoid texture false positives.
  • The change introduces conservative, multi-criteria checks in the frequency domain to prefer precision over recall for stripe detection.

Description

  • Add stripe_detect.cpp implementing a revised detector that separates displayable log-spectrum from the raw centered power spectrum used for decisions.
  • Apply an annular band-pass mask to remove low-frequency scene structure and near-Nyquist noise before analysis, then convert to polar coordinates for angle/radius analysis.
  • Compute an angular energy profile with smoothing and robust truncation (p95), then enforce narrow angular peak width and angular concentration constraints to reject wide-band texture peaks.
  • Validate the candidate by requiring radial prominence (narrow-band peak in radius) and combined thresholds (Z-score, peak ratio, width, concentration, radial prominence) and print diagnostic metrics for tuning.

Testing

  • Attempted to compile with g++ -std=c++17 stripe_detect.cpp -o StripeDetect \pkg-config --cflags --libs opencv4` and the build failed because OpenCV development files were not available (opencv4.pc/opencv2/opencv.hpp` not found).
  • No other automated tests or runtime validation were executed in this environment due to the missing OpenCV dependency.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93fd78e761

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread stripe_detect.cpp
int thetaStripe = thetaF - 90;
if (thetaStripe < 0) thetaStripe += 180;

double stripeSpacing = static_cast<double>(energy.cols) / rPeak;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Compute stripe spacing with both image dimensions

The spacing estimate uses energy.cols / rPeak, which assumes frequency radius is scaled only by the x-axis. In a 2D DFT, the radial frequency depends on both axes (u/N, v/M), so this formula is only correct for peaks on the horizontal frequency 8000 axis; for horizontal stripes or any non-square image/orientation, the reported pixel spacing can be systematically wrong (often by the aspect ratio). This affects experiment accuracy because the detector can report a valid stripe with an incorrect period.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0