Пример #1
0
 //
 //      Return failure upon an attempt to call. New InputDevices should
 //      implement their own.
 //      NB. Tom: Input devices don't necessarily need to implement their own,
 //      as processing is done in the ProcessVideo and TrackSensors functions.
 //      All this needs to really do is store the data locally.
 //      I've left the function virtual just incase a device wants to override
 //      it anyway
 FlightParameters InputDevice::Update(DroneFeedback *data)
 {
     m_data = data;
     PollInput();
     ProcessVideo();
     TrackSensors();
     return m_flightParams;
 }
Пример #2
0
int main(int argc,char** argv) {
	//testvas();
    gArgc = argc;
    gArgv = argv;
    if(argc > 1)
        f = (frameKernel_t)compile_file(argv[1]);
    else
        f = (frameKernel_t)compile_str();
	ProcessVideo();
	release_function((void*&)f);
    if(gVideoIn) free(gVideoIn); 
    if(gVideoOut) free(gVideoOut); 
}
Пример #3
0
tResult cQrPlayer::OnPinEvent(IPin* pSource,
                                            tInt nEventCode,
                                            tInt nParam1,
                                            tInt nParam2,
                                            IMediaSample* pMediaSample)
{
	switch (nEventCode)
    {
        case IPinEventSink::PE_MediaSampleReceived:
        {
			if (pSource == &m_oPinInputVideo)
			{				
				ProcessVideo(pMediaSample);		
			}					
			 break;
        }
        case IPinEventSink::PE_MediaTypeChanged:
        {
            if (pSource == &m_oPinInputVideo)
            {                
                {
					cObjectPtr<IMediaType> pType;
					RETURN_IF_FAILED(m_oPinInputVideo.GetMediaType(&pType));

					cObjectPtr<IMediaTypeVideo> pTypeVideo;
					RETURN_IF_FAILED(pType->GetInterface(IID_ADTF_MEDIA_TYPE_VIDEO, (tVoid**)&pTypeVideo));

					UpdateImageFormat(m_oPinInputVideo.GetFormat());
                }
            }
			break;
        }
		default:
		{
			break;
		}
    }
	
	RETURN_NOERROR;
}
Пример #4
0
int main(int argc, char* argv[])
{
    // Declare the supboost::program_optionsrted options.
    boost::program_options::options_description desc("Allowed options");
    desc.add_options()
        ("help", "produce help message")
        ("video", boost::program_options::value<std::string>(), "video file to be processed")
        ("image", boost::program_options::value<std::string>(), "image file to be processed")
    ;

    boost::program_options::variables_map vm;
    boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
    boost::program_options::notify(vm);

    if (vm.count("help"))
    {
        std::cout << desc << "\n";
        return 1;
    }

    if (vm.count("image"))
    {
        PathDetect pd;
        cv::Mat image = cv::imread(vm["image"].as<std::string>());
        imwrite("originalimage.jpg", image);
        cv::Mat result = pd.GetPath(image);
        imwrite("finalimage.jpg", result);
    }

    if (vm.count("video"))
    {
        ProcessVideo(vm["video"].as<std::string>());

    }

    return 0;

}
Пример #5
0
int main(int argc,char** argv) {
	ProcessVideo(argc,argv);
	//TransVideo (argc,argv);
	//ProcessImg(argc,argv);
}