<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic OpenCV on Xojo in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-on-Xojo/m-p/1158059#M26482</link>
    <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Anyone familiar with Xojo / RealBasic and the port of OpenCV to that environment? &amp;nbsp;I'm trying to use IPL to convert an RGB image to an RGBA image... should be pretty straight forward but I'm crashing...&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; // openCV&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // memoryblock can be used in place of Ptr for external lib&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim img4 as ptr&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim size as CvSize&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim depth as integer&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim nchannels as integer&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim matsize as integer&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim hdrsize as integer&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim img as MemoryBlock&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim imgStruct as IplImage&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; size.Height = dcmImg.mRows&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; size.width = dcmImg.mColumns&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; depth = dcmImg.mBitsStored&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; nchannels = dcmImg.mSamplesPerPixel&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; matsize = dcmImg.getPixelMemoryBlock.Size&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; hdrsize = imgStruct.Size&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; img = cvCreateImage(size,depth,nchannels)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; img.Ptr(108) = dcmImg.getPixelMemoryBlock&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; img.ptr(68) = dcmImg.getPixelMemoryBlock&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // we need a 4 Channels image to be converted in Xojo BitMap Format&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; img4=cvCreateImage(size,depth,4)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; if nChannels &amp;lt;=2 then&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; dim img3 as ptr=cvCreateImage(size,depth,3)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; cvCvtColor(img,img3,CV_GRAY2BGR)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; cvCvtColor(img3,img4,CV_RGB2RGBA)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; else&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; cvCvtColor(img,img4,CV_RGB2RGBA)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; end if&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // to reverse BGRA order for bitMap&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; cvFlip(img4,img4, 0)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // convert to Xojo&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // must be improved for 16 bits&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; if depth&amp;gt;=16 then&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; picture =convert2Picture(img)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; else&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; picture=convert2BMP(img4) // Crashes here ...&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; end if&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Mar 2018 21:46:01 GMT</pubDate>
    <dc:creator>O_Brien__Brian</dc:creator>
    <dc:date>2018-03-22T21:46:01Z</dc:date>
    <item>
      <title>OpenCV on Xojo</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-on-Xojo/m-p/1158059#M26482</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Anyone familiar with Xojo / RealBasic and the port of OpenCV to that environment? &amp;nbsp;I'm trying to use IPL to convert an RGB image to an RGBA image... should be pretty straight forward but I'm crashing...&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;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.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; // openCV&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // memoryblock can be used in place of Ptr for external lib&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim img4 as ptr&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim size as CvSize&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim depth as integer&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim nchannels as integer&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim matsize as integer&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim hdrsize as integer&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim img as MemoryBlock&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; dim imgStruct as IplImage&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; size.Height = dcmImg.mRows&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; size.width = dcmImg.mColumns&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; depth = dcmImg.mBitsStored&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; nchannels = dcmImg.mSamplesPerPixel&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; matsize = dcmImg.getPixelMemoryBlock.Size&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; hdrsize = imgStruct.Size&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; img = cvCreateImage(size,depth,nchannels)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; img.Ptr(108) = dcmImg.getPixelMemoryBlock&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; img.ptr(68) = dcmImg.getPixelMemoryBlock&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // we need a 4 Channels image to be converted in Xojo BitMap Format&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; img4=cvCreateImage(size,depth,4)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; if nChannels &amp;lt;=2 then&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; dim img3 as ptr=cvCreateImage(size,depth,3)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; cvCvtColor(img,img3,CV_GRAY2BGR)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; cvCvtColor(img3,img4,CV_RGB2RGBA)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; else&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; cvCvtColor(img,img4,CV_RGB2RGBA)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; end if&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // to reverse BGRA order for bitMap&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; cvFlip(img4,img4, 0)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // convert to Xojo&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; // must be improved for 16 bits&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; if depth&amp;gt;=16 then&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; picture =convert2Picture(img)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; else&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; picture=convert2BMP(img4) // Crashes here ...&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; end if&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 21:46:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/OpenCV-on-Xojo/m-p/1158059#M26482</guid>
      <dc:creator>O_Brien__Brian</dc:creator>
      <dc:date>2018-03-22T21:46:01Z</dc:date>
    </item>
  </channel>
</rss>

