[ITK-users] built opencv bridge but can't find

Matt McCormick matt.mccormick at kitware.com
Wed Aug 31 10:09:38 EDT 2016


Hi Tammy,

Thanks for sharing your progress and the update! Welcome to ITK :-)

Matt

On Wed, Aug 31, 2016 at 9:32 AM, Tammy Diprima
<tammy.diprima at stonybrook.edu> wrote:
> I think I just answered my own question.  I forgot  sudo make install.  Now
> both itkOpenCVImageBridge files are where they're supposed to be, in
> /usr/local/include/ITK-4.8.
>
> Matt, the chat with you totally helped.  Sorry to interrupt your day, but --
> Thanks very much.  I really appreciate it.  -- T
>
>
> 30 August 2016 at 19:52:
>
>> Hi Matt,
>>
>> Thank you for the advice.  You're right, in that I need not include any
>> OpenCV dirs; it's all about ITK.
>> The problem is, I'm already doing the:
>>
>> find_package( ITK REQUIRED )
>> include( ${ITK_USE_FILE} )
>>
>> The compiler's not happy unless I physically copy the header and source
>> files (itkOpenCVImageBridge.*) from
>> [ITK-SOURCE-DIR]/Modules/Video/BridgeOpenCV/include to a location CMakeLists
>> knows about (in an include directory).  Which makes sense, but I would have
>> thought when I built ITK with the BridgeOpenCV flag turned on that it would
>> have been copied during that particular process.  Oh well.  At least it's
>> working now.
>>
>> Cheers, thanks a lot.
>> Tammy
>>
>>
>> On 30 August 2016 at 13:28, Matt McCormick <matt.mccormick at kitware.com>
>> wrote:
>>>
>>> Hi Tammy,
>>>
>>> Your project's CMakeLists.txt needs:
>>>
>>>   find_package(ITK)
>>>   include(${ITK_USE_FILE})
>>>
>>> The "include(${ITK_USE_FILE})" command calls "include_directories"
>>> with the directories containing itkOpenCVImageBridge.h.
>>>
>>> HTH,
>>> Matt
>>>
>>> On Tue, Aug 30, 2016 at 12:35 PM, Tammy Diprima
>>> <tammy.diprima at stonybrook.edu> wrote:
>>> > OK I have an update.  So, set() worked to reset the broken variable
>>> > (workaround).  And then I had to locate itkOpenCVImageBridge.* and copy
>>> > the
>>> > files to the location.
>>> >
>>> > That worked.
>>> >
>>> > But -- does anybody have an idea how I could have broken
>>> > OpenCV_INCLUDE_DIRS
>>> > in the first place?
>>> > And also -- something tells me I shouldn't have had to copy the source
>>> > files
>>> > to the OpenCV_INCLUDE_DIRS.  What did I do wrong?
>>> >
>>> > Thanks again.
>>> >
>>> >
>>> >
>>> > 30 August 2016 at 12:25:
>>> >
>>> >> I re-ran ccmake on ITK with Module_ITKVideoBridgeOpenCV:BOOL=ON.
>>> >> I recompiled using make.
>>> >>
>>> >> In my C++ program I'm including the headers:
>>> >> #include <opencv2/opencv.hpp>
>>> >> #include "itkOpenCVImageBridge.h"
>>> >>
>>> >> But it's saying "cannot find itkOpenCVImageBridge.h"
>>> >>
>>> >> I put messaging output in my CMakeLists.txt:
>>> >> include_directories(${OpenCV_INCLUDE_DIRS})
>>> >> MESSAGE( STATUS "OpenCV_INCLUDE_DIRS " ${OpenCV_INCLUDE_DIRS} )
>>> >>
>>> >> And the output shows that the directory is incorrect:
>>> >> OpenCV_INCLUDE_DIRS /usr/local/include/opencv/usr/local/include
>>> >>
>>> >> This might be what's causing the problem.  I tried to do a set() but
>>> >> it
>>> >> didn't seem to fix it.
>>> >>
>>> >> Can somebody please advise?
>>> >>
>>> >> Thanks.
>>> >
>>> >
>>> >
>>> > _____________________________________
>>> > Powered by www.kitware.com
>>> >
>>> > Visit other Kitware open-source projects at
>>> > http://www.kitware.com/opensource/opensource.html
>>> >
>>> > Kitware offers ITK Training Courses, for more information visit:
>>> > http://www.kitware.com/products/protraining.php
>>> >
>>> > Please keep messages on-topic and check the ITK FAQ at:
>>> > http://www.itk.org/Wiki/ITK_FAQ
>>> >
>>> > Follow this link to subscribe/unsubscribe:
>>> > http://public.kitware.com/mailman/listinfo/insight-users
>>> >
>>
>>
>


More information about the Insight-users mailing list