700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 【OpenCV4】opencv2/core/core.hpp : No such file or directory

【OpenCV4】opencv2/core/core.hpp : No such file or directory

时间:2020-12-20 13:35:36

相关推荐

【OpenCV4】opencv2/core/core.hpp : No such file or directory

由于最新的从github上下载下来的源码已经更新到了4.x

所以在配置Qt的pro文件的时候网上的大部分示例代码都会出这个问题

当然使用VS或者是什么其他的IDE也是一样

clone下来的源码的目录结构是 opencv4/opencv2/...

可以看一下opencv4.x版本的目录结构:

opencv4└── opencv2├── aruco│ ├── charuco.hpp│ └── dictionary.hpp├── aruco.hpp├── bgsegm.hpp├── bioinspired│ ├── bioinspired.hpp│ ├── retinafasttonemapping.hpp│ ├── retina.hpp│ └── transientareassegmentationmodule.hpp├── bioinspired.hpp├── calib3d│ ├── calib3d_c.h│ └── calib3d.hpp├── calib3d.hpp├── ccalib│ ├── multicalib.hpp│ ├── omnidir.hpp│ └── randpattern.hpp├── ccalib.hpp├── core│ ├── affine.hpp│ ├── base.hpp│ ├── bindings_utils.hpp│ ├── bufferpool.hpp│ ├── check.hpp│ ├── core_c.h│ ├── core.hpp│ ├── cuda│ │ ├── block.hpp│ │ ├── border_interpolate.hpp│ │ ├── color.hpp│ │ ├── common.hpp│ │ ├── datamov_utils.hpp│ │ ├── detail│ │ │ ├── color_detail.hpp│ │ │ ├── reduce.hpp│ │ │ ├── reduce_key_val.hpp│ │ │ ├── transform_detail.hpp│ │ │ ├── type_traits_detail.hpp│ │ │ └── vec_distance_detail.hpp│ │ ├── dynamic_smem.hpp│ │ ├── emulation.hpp│ │ ├── filters.hpp│ │ ├── funcattrib.hpp│ │ ├── functional.hpp│ │ ├── limits.hpp│ │ ├── reduce.hpp│ │ ├── saturate_cast.hpp│ │ ├── scan.hpp│ │ ├── simd_functions.hpp│ │ ├── transform.hpp│ │ ├── type_traits.hpp│ │ ├── utility.hpp│ │ ├── vec_distance.hpp│ │ ├── vec_math.hpp│ │ ├── vec_traits.hpp│ │ ├── warp.hpp│ │ ├── warp_reduce.hpp│ │ └── warp_shuffle.hpp│ ├── cuda.hpp│ ├── cuda.inl.hpp│ ├── cuda_stream_accessor.hpp│ ├── cuda_types.hpp│ ├── cv_cpu_dispatch.h│ ├── cv_cpu_helper.h│ ├── cvdef.h│ ├── cvstd.hpp│ ├── cvstd.inl.hpp│ ├── cvstd_wrapper.hpp│ ├── directx.hpp│ ├── eigen.hpp│ ├── fast_math.hpp│ ├── hal│ │ ├── hal.hpp│ │ ├── interface.h│ │ ├── intrin_avx.hpp│ │ ├── intrin_cpp.hpp│ │ ├── intrin_forward.hpp│ │ ├── intrin.hpp│ │ ├── intrin_neon.hpp│ │ ├── intrin_sse_em.hpp│ │ ├── intrin_sse.hpp│ │ └── intrin_vsx.hpp│ ├── mat.hpp│ ├── mat.inl.hpp│ ├── matx.hpp│ ├── neon_utils.hpp│ ├── ocl_genbase.hpp│ ├── ocl.hpp│ ├── opencl│ │ ├── ocl_defs.hpp│ │ ├── opencl_info.hpp│ │ ├── opencl_svm.hpp│ │ └── runtime│ │├── autogenerated│ ││ ├── opencl_clamdblas.hpp│ ││ ├── opencl_clamdfft.hpp│ ││ ├── opencl_core.hpp│ ││ ├── opencl_core_wrappers.hpp│ ││ ├── opencl_gl.hpp│ ││ └── opencl_gl_wrappers.hpp│ │├── opencl_clamdblas.hpp│ │├── opencl_clamdfft.hpp│ │├── opencl_core.hpp│ │├── opencl_core_wrappers.hpp│ │├── opencl_gl.hpp│ │├── opencl_gl_wrappers.hpp│ │├── opencl_svm_20.hpp│ │├── opencl_svm_definitions.hpp│ │└── opencl_svm_hsa_extension.hpp│ ├── opengl.hpp│ ├── operations.hpp│ ├── optim.hpp│ ├── ovx.hpp│ ├── persistence.hpp│ ├── saturate.hpp│ ├── softfloat.hpp│ ├── sse_utils.hpp│ ├── traits.hpp│ ├── types_c.h│ ├── types.hpp│ ├── utility.hpp│ ├── utils│ │ ├── filesystem.hpp│ │ ├── logger.defines.hpp│ │ ├── logger.hpp│ │ └── trace.hpp│ ├── va_intel.hpp│ ├── version.hpp│ └── vsx_utils.hpp├── core_detect.hpp├── core.hpp├── cvconfig.h├── datasets│ ├── ar_hmdb.hpp│ ├── ar_sports.hpp│ ├── dataset.hpp│ ├── fr_adience.hpp│ ├── fr_lfw.hpp│ ├── gr_chalearn.hpp│ ├── gr_skig.hpp│ ├── hpe_humaneva.hpp│ ├── hpe_parse.hpp│ ├── ir_affine.hpp│ ├── ir_robot.hpp│ ├── is_bsds.hpp│ ├── is_weizmann.hpp│ ├── msm_epfl.hpp│ ├── msm_middlebury.hpp│ ├── or_imagenet.hpp│ ├── or_mnist.hpp│ ├── or_pascal.hpp│ ├── or_sun.hpp│ ├── pd_caltech.hpp│ ├── pd_inria.hpp│ ├── slam_kitti.hpp│ ├── slam_tumindoor.hpp│ ├── track_alov.hpp│ ├── track_vot.hpp│ ├── tr_chars.hpp│ ├── tr_icdar.hpp│ ├── tr_svt.hpp│ └── util.hpp├── dnn│ ├── all_layers.hpp│ ├── dict.hpp│ ├── dnn.hpp│ ├── dnn.inl.hpp│ ├── layer.details.hpp│ ├── layer.hpp│ ├── shape_utils.hpp│ ├── utils│ │ └── inference_engine.hpp│ └── version.hpp├── dnn.hpp├── dpm.hpp├── face│ ├── bif.hpp│ ├── face_alignment.hpp│ ├── facemarkAAM.hpp│ ├── facemark.hpp│ ├── facemarkLBF.hpp│ ├── facemark_train.hpp│ ├── facerec.hpp│ ├── mace.hpp│ └── predict_collector.hpp├── face.hpp├── features2d│ ├── features2d.hpp│ └── hal│└── interface.h├── features2d.hpp├── flann│ ├── all_indices.h│ ├── allocator.h│ ├── any.h│ ├── autotuned_index.h│ ├── composite_index.h│ ├── config.h│ ├── defines.h│ ├── dist.h│ ├── dummy.h│ ├── dynamic_bitset.h│ ├── flann_base.hpp│ ├── flann.hpp│ ├── general.h│ ├── ground_truth.h│ ├── heap.h│ ├── hierarchical_clustering_index.h│ ├── index_testing.h│ ├── kdtree_index.h│ ├── kdtree_single_index.h│ ├── kmeans_index.h│ ├── linear_index.h│ ├── logger.h│ ├── lsh_index.h│ ├── lsh_table.h│ ├── matrix.h│ ├── miniflann.hpp│ ├── nn_index.h│ ├── object_factory.h│ ├── params.h│ ├── random.h│ ├── result_set.h│ ├── sampling.h│ ├── saving.h│ ├── simplex_downhill.h│ └── timer.h├── flann.hpp├── freetype.hpp├── fuzzy│ ├── fuzzy_F0_math.hpp│ ├── fuzzy_F1_math.hpp│ ├── fuzzy_image.hpp│ └── types.hpp├── fuzzy.hpp├── gapi│ ├── core.hpp│ ├── cpu│ │ ├── core.hpp│ │ ├── gcpukernel.hpp│ │ └── imgproc.hpp│ ├── fluid│ │ ├── core.hpp│ │ ├── gfluidbuffer.hpp│ │ ├── gfluidkernel.hpp│ │ └── imgproc.hpp│ ├── garg.hpp│ ├── garray.hpp│ ├── gcall.hpp│ ├── gcommon.hpp│ ├── gcompiled.hpp│ ├── gcompoundkernel.hpp│ ├── gcomputation.hpp│ ├── gkernel.hpp│ ├── gmat.hpp│ ├── gmetaarg.hpp│ ├── gproto.hpp│ ├── gpu│ │ ├── core.hpp│ │ ├── ggpukernel.hpp│ │ └── imgproc.hpp│ ├── gscalar.hpp│ ├── gtyped.hpp│ ├── gtype_traits.hpp│ ├── imgproc.hpp│ ├── ocl│ │ ├── core.hpp│ │ ├── goclkernel.hpp│ │ └── imgproc.hpp│ ├── opencv_includes.hpp│ ├── operators.hpp│ ├── own│ │ ├── assert.hpp│ │ ├── convert.hpp│ │ ├── cvdefs.hpp│ │ ├── exports.hpp│ │ ├── mat.hpp│ │ ├── saturate.hpp│ │ ├── scalar.hpp│ │ └── types.hpp│ └── util│├── any.hpp│├── compiler_hints.hpp│├── optional.hpp│├── throw.hpp│├── util.hpp│└── variant.hpp├── gapi.hpp├── hdf│ └── hdf5.hpp├── hdf.hpp├── hfs.hpp├── highgui│ ├── highgui_c.h│ └── highgui.hpp├── highgui.hpp├── imgcodecs│ ├── imgcodecs_c.h│ ├── imgcodecs.hpp│ ├── ios.h│ └── legacy│└── constants_c.h├── imgcodecs.hpp├── img_hash│ ├── average_hash.hpp│ ├── block_mean_hash.hpp│ ├── color_moment_hash.hpp│ ├── img_hash_base.hpp│ ├── marr_hildreth_hash.hpp│ ├── phash.hpp│ └── radial_variance_hash.hpp├── img_hash.hpp├── imgproc│ ├── detail│ │ └── gcgraph.hpp│ ├── hal│ │ ├── hal.hpp│ │ └── interface.h│ ├── imgproc_c.h│ ├── imgproc.hpp│ └── types_c.h├── imgproc.hpp├── line_descriptor│ └── descriptor.hpp├── line_descriptor.hpp├── ml│ ├── ml.hpp│ └── ml.inl.hpp├── ml.hpp├── objdetect│ ├── detection_based_tracker.hpp│ └── objdetect.hpp├── objdetect.hpp├── opencv.hpp├── opencv_modules.hpp├── optflow│ ├── motempl.hpp│ ├── pcaflow.hpp│ ├── rlofflow.hpp│ └── sparse_matching_gpc.hpp├── optflow.hpp├── phase_unwrapping│ ├── histogramphaseunwrapping.hpp│ └── phase_unwrapping.hpp├── phase_unwrapping.hpp├── photo│ ├── cuda.hpp│ ├── legacy│ │ └── constants_c.h│ └── photo.hpp├── photo.hpp├── plot.hpp├── quality│ ├── qualitybase.hpp│ ├── qualitybrisque.hpp│ ├── qualitygmsd.hpp│ ├── qualitymse.hpp│ ├── qualitypsnr.hpp│ ├── qualityssim.hpp│ └── quality_utils.hpp├── quality.hpp├── reg│ ├── mapaffine.hpp│ ├── map.hpp│ ├── mappergradaffine.hpp│ ├── mappergradeuclid.hpp│ ├── mappergradproj.hpp│ ├── mappergradshift.hpp│ ├── mappergradsimilar.hpp│ ├── mapper.hpp│ ├── mapperpyramid.hpp│ ├── mapprojec.hpp│ └── mapshift.hpp├── rgbd│ ├── depth.hpp│ ├── kinfu.hpp│ └── linemod.hpp├── rgbd.hpp├── saliency│ ├── saliencyBaseClasses.hpp│ └── saliencySpecializedClasses.hpp├── saliency.hpp├── sfm│ ├── conditioning.hpp│ ├── fundamental.hpp│ ├── io.hpp│ ├── numeric.hpp│ ├── projection.hpp│ ├── reconstruct.hpp│ ├── robust.hpp│ ├── simple_pipeline.hpp│ └── triangulation.hpp├── sfm.hpp├── shape│ ├── emdL1.hpp│ ├── hist_cost.hpp│ ├── shape_distance.hpp│ ├── shape.hpp│ └── shape_transformer.hpp├── shape.hpp├── stereo│ ├── descriptor.hpp│ ├── matching.hpp│ ├── quasi_dense_stereo.hpp│ └── stereo.hpp├── stereo.hpp├── stitching│ ├── detail│ │ ├── autocalib.hpp│ │ ├── blenders.hpp│ │ ├── camera.hpp│ │ ├── exposure_compensate.hpp│ │ ├── matchers.hpp│ │ ├── motion_estimators.hpp│ │ ├── seam_finders.hpp│ │ ├── timelapsers.hpp│ │ ├── util.hpp│ │ ├── util_inl.hpp│ │ ├── warpers.hpp│ │ └── warpers_inl.hpp│ └── warpers.hpp├── stitching.hpp├── structured_light│ ├── graycodepattern.hpp│ ├── sinusoidalpattern.hpp│ └── structured_light.hpp├── structured_light.hpp├── superres│ └── optical_flow.hpp├── superres.hpp├── surface_matching│ ├── icp.hpp│ ├── pose_3d.hpp│ ├── ppf_helpers.hpp│ ├── ppf_match_3d.hpp│ └── t_hash_int.hpp├── surface_matching.hpp├── text│ ├── erfilter.hpp│ ├── ocr.hpp│ └── textDetector.hpp├── text.hpp├── tracking│ ├── feature.hpp│ ├── kalman_filters.hpp│ ├── onlineBoosting.hpp│ ├── onlineMIL.hpp│ ├── tldDataset.hpp│ ├── tracker.hpp│ └── tracking.hpp├── tracking.hpp├── video│ ├── background_segm.hpp│ ├── legacy│ │ └── constants_c.h│ ├── tracking.hpp│ └── video.hpp├── video.hpp├── videoio│ ├── cap_ios.h│ ├── legacy│ │ └── constants_c.h│ ├── registry.hpp│ ├── videoio_c.h│ └── videoio.hpp├── videoio.hpp├── videostab│ ├── deblurring.hpp│ ├── fast_marching.hpp│ ├── fast_marching_inl.hpp│ ├── frame_source.hpp│ ├── global_motion.hpp│ ├── inpainting.hpp│ ├── log.hpp│ ├── motion_core.hpp│ ├── motion_stabilizing.hpp│ ├── optical_flow.hpp│ ├── outlier_rejection.hpp│ ├── ring_buffer.hpp│ ├── stabilizer.hpp│ └── wobble_suppression.hpp├── videostab.hpp├── xfeatures2d│ ├── cuda.hpp│ └── nonfree.hpp├── xfeatures2d.hpp├── ximgproc│ ├── brightedges.hpp│ ├── color_match.hpp│ ├── deriche_filter.hpp│ ├── disparity_filter.hpp│ ├── edgeboxes.hpp│ ├── edge_filter.hpp│ ├── edgepreserving_filter.hpp│ ├── estimated_covariance.hpp│ ├── fast_hough_transform.hpp│ ├── fast_line_detector.hpp│ ├── fourier_descriptors.hpp│ ├── lsc.hpp│ ├── paillou_filter.hpp│ ├── peilin.hpp│ ├── ridgefilter.hpp│ ├── run_length_morphology.hpp│ ├── seeds.hpp│ ├── segmentation.hpp│ ├── slic.hpp│ ├── sparse_match_interpolator.hpp│ ├── structured_edge_detection.hpp│ └── weighted_median_filter.hpp├── ximgproc.hpp├── xobjdetect.hpp├── xphoto│ ├── bm3d_image_denoising.hpp│ ├── dct_image_denoising.hpp│ ├── inpainting.hpp│ ├── oilpainting.hpp│ ├── tonemap.hpp│ └── white_balance.hpp└── xphoto.hpp

所以修改.pro文件中导入路径

修改前:(网上的绝大部分示例代码)

INCLUDEPATH += /usr/local/include \/usr/local/include/opencv \/usr/local/include/opencv2

修改后:

INCLUDEPATH += /usr/local/include/opencv4

即其实要用<opencv2/xxxx.h>这样的头文件,其实只要上面配一行倒入即可

因为从上面的目录结构可以分析出来,opencv4文件夹下仅仅有opencv2一个文件夹

补充一个小技巧,opencv4.x版本的一个重大改进就是有了一个很好用的类似“万能头文件的东西”:

<opencv2/opencv.hpp>

这个文件是一个opencv的顶层头文件,里面引用了几乎所有常见的opencv库中的头文件

所以在使用opencv库的时候只需要引入这样一行头文件即可

#include <opencv2/opencv.hpp>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。