gpt4 book ai didi

java - 适用于 Android 的 OpenCV : Illegal Forward Reference

转载 作者:行者123 更新时间:2023-12-03 21:37:51 24 4
gpt4 key购买 nike

我正在使用 OpenCV对于我的项目,一切正常,除了 DescriptorExtractor.java .它每天都给我以下错误:

/opencv/src/org/opencv/features2d/DescriptorExtractor.java
Error:(26, 29) error: illegal forward reference
Error:(27, 29) error: illegal forward reference
Error:(28, 28) error: illegal forward reference
Error:(29, 30) error: illegal forward reference
Error:(30, 30) error: illegal forward reference
Error:(31, 30) error: illegal forward reference
Error:(32, 30) error: illegal forward reference

该文件最初如下所示:
public class DescriptorExtractor {

public static final int
SIFT = 1,
SURF = 2,
ORB = 3,
BRIEF = 4,
BRISK = 5,
FREAK = 6,
AKAZE = 7,
OPPONENT_SIFT = OPPONENTEXTRACTOR + SIFT,
OPPONENT_SURF = OPPONENTEXTRACTOR + SURF,
OPPONENT_ORB = OPPONENTEXTRACTOR + ORB,
OPPONENT_BRIEF = OPPONENTEXTRACTOR + BRIEF,
OPPONENT_BRISK = OPPONENTEXTRACTOR + BRISK,
OPPONENT_FREAK = OPPONENTEXTRACTOR + FREAK,
OPPONENT_AKAZE = OPPONENTEXTRACTOR + AKAZE;
private static final int
OPPONENTEXTRACTOR = 1000;
protected final long nativeObj;

每天我都在移动 OPPONENTEXTRACTOR的声明名列前茅,问题就消失了。但是第二天类(class)又恢复到原来的样子。在类的顶部有一个评论
//
// This file is auto-generated. Please don't modify it!
//

我应该怎么办?我该如何防止这种情况?

更新:

我正在为 Android 3.0 和 Java 7.80 使用 OpenCV

最佳答案

您的申报顺序错误。它应该是这样的:

private static final int OPPONENTEXTRACTOR = 1000;

public static final int
SIFT = 1,
SURF = 2,
ORB = 3,
BRIEF = 4,
BRISK = 5,
FREAK = 6,
AKAZE = 7,
OPPONENT_SIFT = OPPONENTEXTRACTOR + SIFT,
OPPONENT_SURF = OPPONENTEXTRACTOR + SURF,
OPPONENT_ORB = OPPONENTEXTRACTOR + ORB,
OPPONENT_BRIEF = OPPONENTEXTRACTOR + BRIEF,
OPPONENT_BRISK = OPPONENTEXTRACTOR + BRISK,
OPPONENT_FREAK = OPPONENTEXTRACTOR + FREAK,
OPPONENT_AKAZE = OPPONENTEXTRACTOR + AKAZE;

关于java - 适用于 Android 的 OpenCV : Illegal Forward Reference,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33050672/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com