EyesWeb XMI Forum
http://forum.eyesweb.infomus.org/

Load picture from file
http://forum.eyesweb.infomus.org/viewtopic.php?f=25&t=661
Page 1 of 1

Author:  CarolineB [ 19 Nov 2010, 12:07 ]
Post subject:  Load picture from file

Hello!

I am totally new to EyesWeb and I have a problem...
I want to load a picture from a file on my computer in to a eyesWeb-block.
How can I do this? After loading the picture I want to modify it and then have it as an output.

// Caroline

Author:  paolo [ 19 Nov 2010, 16:54 ]
Post subject:  Re: Load picture from file

Attached is an example patch

Paolo

Attachments:
LoadPictureFromFile.eywx [55.75 KiB]
Downloaded 11265 times

Author:  CarolineB [ 22 Nov 2010, 10:08 ]
Post subject:  Re: Load picture from file

Thank you! :)

I have another problem too, can I convert openCv fileformat("IplImage") to EyesWeb format ("Image") in code?
I want to do it in a block I already created.

Author:  paolo [ 23 Nov 2010, 12:59 ]
Post subject:  Re: Load picture from file

CarolineB wrote:
Thank you! :)

I have another problem too, can I convert openCv fileformat("IplImage") to EyesWeb format ("Image") in code?
I want to do it in a block I already created.


The EyesWeb Image datatype has methods (CopyFromBuffer) to copy the content from a user-specified memory buffer, thus, you can copy/convert the content of the EyesWeb image from the data field of the IplImage struct. If you wan to avoid the copy you can create an EyesWeb image that uses the same buffer as the IplImage, by passing the data field of the IplImage as a second argument to the InitInstance method of the EyesWeb image.
You can also work in the opposite way, i.e., creating an IplImage that matches the EyesWeb image format, by using the CopyToBuffer method of the EyesWeb Image (using the data field of the IplImage as the destination). If you want to avoid the copy you can set the data field to point to the same buffer as the EyesWeb image (which you can obtain by means of the GetBuffer method).

Please note that if you share the memory between the EyesWeb and the IplImage in either way, the EyesWeb image should be used only internally to your block. I.e., the optimized method which does noe need to copy memory cannot be used for input/output images, but only for images used for internal processing inside the block.

Paolo

Author:  CarolineB [ 24 Nov 2010, 00:23 ]
Post subject:  Re: Load picture from file

There can I find information about this methods (CopyFromBuffer,CopyToBuffer)? I search on internet and looked in EywImage.h but cant find anything?

Author:  paolo [ 24 Nov 2010, 16:27 ]
Post subject:  Re: Load picture from file

CarolineB wrote:
There can I find information about this methods (CopyFromBuffer,CopyToBuffer)? I search on internet and looked in EywImage.h but cant find anything?


It's from the IMemoryBuffer interface, from which IImage inherits. The file is EywMemoryBuffer.h

Paolo

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/