Navigation

    VisionAppster.com

    VisionAppster Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Keijo
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Keijo

    @Keijo

    Global Moderator

    1
    Reputation
    1
    Posts
    118
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Keijo Follow
    Global Moderator administrators

    Posts made by Keijo

    • RE: read images from a file in C API tool

      @luqt123
      Hi Lukas,

      Assuming that you have already allocated space for your kuvio_image, you can copy it across using OpenCv functions. Possible functions for this are for example cv::cvtColor, cv::mixChannels and cv::merge. Please read OpenCv documentation on how they are used.

      For example, if your opencv image is a 24-bit RGB image, the copying can be done simply as follows:

      int my_opencv_function(/*params,*/  kuvio_image* imgOut)
      {
        if (imgOut->type == kuvio_rgb32_image_type)
          {
            cv::Mat myOpenCvImage = ... // Get or create an RGB image. eg. cv::imread
            /// ...do stuff with the image and copy to kuvio_image
            cv::mixChannels(myOpenCvImage, OpenCvMat(imgOut, OpenCvMat::Rgb24), {0, 0, 1, 1, 2, 2});
      }
      

      Please bear in mind that the sizes of the allocated kuvio_image and the size of the image in cv::Mat myOpenCvImage must be identical.

      posted in Tools
      Keijo