View unanswered posts | View active topics It is currently 18 Nov 2017, 06:16



Reply to topic  [ 6 posts ] 
Load picture from file 
Author Message
Reply with quote
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


19 Nov 2010, 12:07

Joined: 21 Mar 2008, 22:35
Posts: 131
Reply with quote
Attached is an example patch

Paolo


Attachments:
LoadPictureFromFile.eywx [55.75 KiB]
Downloaded 515 times
19 Nov 2010, 16:54
Profile
Reply with quote
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.


22 Nov 2010, 10:08

Joined: 21 Mar 2008, 22:35
Posts: 131
Reply with quote
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


23 Nov 2010, 12:59
Profile
Reply with quote
There can I find information about this methods (CopyFromBuffer,CopyToBuffer)? I search on internet and looked in EywImage.h but cant find anything?


24 Nov 2010, 00:23

Joined: 21 Mar 2008, 22:35
Posts: 131
Reply with quote
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


24 Nov 2010, 16:27
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.