OpFastCorner.h#

Fully qualified name: public/src/operator/include/OpFastCorner.h

File members: public/src/operator/include/OpFastCorner.h

/*
 * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
 *
 * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
 * property and proprietary rights in and to this material, related
 * documentation and any modifications thereto. Any use, reproduction,
 * disclosure or distribution of this material and related documentation
 * without an express license agreement from NVIDIA CORPORATION or
 * its affiliates is strictly prohibited.
 */

#ifndef PVA_SOLUTIONS_FASTCORNER_H
#define PVA_SOLUTIONS_FASTCORNER_H

#include <PvaOperator.h>
#include <PvaOperatorTypes.h>
#include <cupva_host_scheduling.h>
#include <nvcv/BorderType.h>
#include <nvcv/Status.h>
#include <nvcv/Tensor.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
 * The FAST corner detection algorithm evaluates a candidate pixel by examining
 * a circular area of surrounding pixels. A pixel is classified as a corner if
 * a specified number \( N \) of contiguous pixels in the circle are either
 * significantly brighter or darker than the candidate pixel, based on a defined
 * intensity threshold.
 *
 * The algorithm may apply non-maximum suppression to eliminate redundant detections,
 * keeping only the candidate pixel if its intensity is larger than that of its
 * immediate neighbors.
 *
 */
typedef struct PvaFastCornerDetectorParamsRec
{
    int32_t circleRadius;

    int32_t arcLength;

    uint8_t nonMaxSuppression;
} PvaFastCornerDetectorParams;

NVCVStatus pvaFastCornerDetectorCreate(NVCVOperatorHandle *handle,
                                       NVCVTensorRequirements const *const tensorRequirements,
                                       PvaFastCornerDetectorParams const *const params, NVCVBorderType borderMode,
                                       int32_t borderValue);

NVCVStatus pvaFastCornerDetectorSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVTensorHandle in,
                                       int32_t intensityThreshold, NVCVTensorHandle loc, NVCVTensorHandle numLoc);

#ifdef __cplusplus
}
#endif

#endif /* PVA_SOLUTIONS_FASTCORNER_H */