Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

OpenCV on Xojo


Anyone familiar with Xojo / RealBasic and the port of OpenCV to that environment?  I'm trying to use IPL to convert an RGB image to an RGBA image... should be pretty straight forward but I'm crashing...

This should be quite simple I have a memory block or RGB samples in a matrix form all packed no column rounding even or odd widths.



    // openCV
    // memoryblock can be used in place of Ptr for external lib 
    dim img4 as ptr
    dim size as CvSize
    dim depth as integer
    dim nchannels as integer
    dim matsize as integer
    dim hdrsize as integer
    dim img as MemoryBlock
    dim imgStruct as IplImage
    size.Height = dcmImg.mRows
    size.width = dcmImg.mColumns
    depth = dcmImg.mBitsStored
    nchannels = dcmImg.mSamplesPerPixel
    matsize = dcmImg.getPixelMemoryBlock.Size
    hdrsize = imgStruct.Size
    img = cvCreateImage(size,depth,nchannels)
    img.Ptr(108) = dcmImg.getPixelMemoryBlock
    img.ptr(68) = dcmImg.getPixelMemoryBlock
    // we need a 4 Channels image to be converted in Xojo BitMap Format
    if nChannels <=2 then
      dim img3 as ptr=cvCreateImage(size,depth,3)
    end if
    // to reverse BGRA order for bitMap
    cvFlip(img4,img4, 0)
    // convert to Xojo
    // must be improved for 16 bits
    if depth>=16 then
      picture =convert2Picture(img)
      picture=convert2BMP(img4) // Crashes here ...
    end if


0 Kudos
0 Replies