-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not parse declaration at '{' in the code of struct #62
Comments
I've tried it here and it works just fine. Make sure to run |
…ct` constructs, and skip over pointer names too (issue bytedeco/javacpp-presets#62)
The actual problematic code is the following: class VideoObjectInfo
{
public:
typedef struct _frameInfo
{
int frameNum;//帧编号
int moveObjectCount;//当前帧中运动目标总个数
std::vector<int> objectList;//用于存储当前帧中所用运动目标信息
_frameInfo()
{ //num:21
frameNum = -1;
moveObjectCount = 0;
}
_frameInfo(int num)
{
frameNum = num;
moveObjectCount = 0;
}
void addObjectInfo(int rect)//向帧中添加一个新的运动目标信息
{
objectList.push_back(rect);
moveObjectCount++;
}
}FrameInfo,*FrameInfoPtr;
}; |
this is the head file : //完成单帧中运动目标信息的提取
//整段视频中运动目标信息的保存、读取功能
#pragma once
#include <fstream>
#include <string>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
class VideoObjectInfo
{
public:
//继续定义帧结构,用于保存单帧中所有运动目标信息
typedef struct _frameInfo
{
int frameNum;//帧编号
int moveObjectCount;//当前帧中运动目标总个数
std::vector<cv::Rect> objectList;//用于存储当前帧中所用运动目标信息
_frameInfo()
{
frameNum = -1;
moveObjectCount = 0;
}
_frameInfo(int num)
{
frameNum = num;
moveObjectCount = 0;
}
void addObjectInfo(cv::Rect rect)//向帧中添加一个新的运动目标信息
{
objectList.push_back(rect);
moveObjectCount++;
}
}FrameInfo,*FrameInfoPtr;
private:
int frameCount;//当前视频中帧的总个数
int dynamicFrameCount;//当前视频动态帧个数
int staticFrameCount;//当前视频静态帧个数,通过三者,判断当前视频类型
std::vector<FrameInfoPtr> frameList;//存放所有信息
std::string videoName;
std::string startTime;
public:
VideoObjectInfo();
VideoObjectInfo(std::string &videoName);
std::string getVideoTime(std::string & filename);//根据文件绝对路径信息,分析提取视频起始时间信息
void extractObjectInfo(cv::Mat &foreground,int frameID);
void extractObjectInfo(cv::Mat & frame,cv::Mat &foreground,int frameID);//提取当前给出的前景图中的前景信息
void saveObjectInfo(std::string &filename);//将信息保存到系统文件中
void readObjectInfo(std::string &filename);//从系统文件中读取信息,用于视频的分类,设计时将考虑的内容分添加进来
int analyzeVideoType();//根据静态帧与动态帧的比例,判定当前帧的视频场景,稀疏0,规律1,稠密
std::vector<FrameInfoPtr> getFrameList();
int getDynamicFrameCount();
std::string getStartTime();
}; and the presets file: package org.bytedeco.javacpp.presets;
import org.bytedeco.javacpp.annotation.Platform;
import org.bytedeco.javacpp.annotation.Properties;
import org.bytedeco.javacpp.tools.Info;
import org.bytedeco.javacpp.tools.InfoMap;
import org.bytedeco.javacpp.tools.InfoMapper;
/**
* Created by lxy on 15-6-25.
*/
@Properties( target="org.bytedeco.javacpp.videoObjectInfo",
value={@Platform(include="<videoObjectInfo.h>",includepath="/usr/local/include/opencv",link="videoabstraction@.so")})
public class videoObjectInfo implements InfoMapper{
@Override
public void map(InfoMap infoMap) {
infoMap.put(new Info("std::String").cast().valueTypes("String"));
infoMap.put(new Info("cv::Mat").cast().pointerTypes("BytePointer"));
infoMap.put(new Info("FrameInfoPtr").cast().pointerTypes("Pointer"));
infoMap.put(new Info("std::vector<FrameInfoPtr>").cast().pointerTypes("Pointer"));
infoMap.put(new Info("cv::Rect").cast().pointerTypes("BytePointer"));
}
} the errors:
|
You're going to need to add something like these two lines to the infoMap.put(new Info("VideoObjectInfo::FrameInfoPtr").valueTypes("VideoObjectInfo.FrameInfo"))
infoMap.put(new Info("std::vector<VideoObjectInfo::FrameInfoPtr>").pointerTypes("FrameInfoVector").define()) |
The perfect solution for your answer to my question,thank you very much. |
there is a error when calling "mvn clean package --projects myproject". I need your help!!!
the maven error :
the code :
The text was updated successfully, but these errors were encountered: