ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 User Demos and Apps
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 7

spetric

Croatia
221 Posts

Posted - Oct 07 2016 :  04:51:27  Show Profile  Reply
Hi Klaus,

Sorry for delayed answer (I was really busy last few months).
Regarding SIFT, I have managed to compile source code I found on IPOL journal and it works quite well.
It does not depend on any runtime libraries. I'll do some more testing and after that
I'll create a library (static and DLL) and upload it together with demo program.

So, it will be possible to use it from Delphi.
Go to Top of Page

spetric

Croatia
221 Posts

Posted - Oct 11 2016 :  16:41:19  Show Profile  Reply
Done!

Here is a DLL and demo application described in IPOL Journal:

http://www.ipol.im/pub/art/2012/mmm-oh/

Source code in C is freely available and I wrapped it up in DLL so it can be used from Delphi. All parameters are described in article on link above and all necessary structures and DLL entries are described in Orsa.h header that goes with this DLL.

Demo application and Orsa.dll do not require any obscure runtime libraries.



Usage: first load source (sample) and target (master) image.
Then you can click Calc. source SIFT descriptor, Calc. target SIFT descriptor and then click Calc. source/target matching or you can click immediately Calc. source/target matching and program will first calculate source and target descriptors and then calculate source/target matching.

After source/target matching is calculated, you can click Orsa homography to run RANSAC/ORSA homography estimation.

There are three output images: Panorama, Registered image 1 and Registered image 2 (same as in demo on IPOL jurnal pages). If two input images are of "panoramic" sort they will be stitched together in panorama output.

Here is demo application (with source code) and DLL (without source code, source code is really messy)

attach/spetric/2016101116368_orsa_distrib.zip
6062.58 KB

Known bugs: you can select background color to fill output images (panorama, reg1 and reg2), but method fill in template class does not work correctly, so use either clWhite or clBlack. It's some obscure template class and I need to carefully examine the code.

Note: Input bitmaps must be of type ie24RGB. Alpha channel is not supported, but I'll try to implement it in future.

Note: To call DLL from Delphi you only need to convert Orsa.h header file to Pascal. There are only structs (records) and DLL entry typedefs.

Have fun,
Siniša

Edit1: orsaIntersection structure in Orsa.h gives intersection box, i.e. a box that encloses a part where two images intersect. It's useful if you want to blend images reg1 and reg2 to avoid visible stitches. Intersection box coordinates are based on target image.
Go to Top of Page

spetric

Croatia
221 Posts

Posted - Oct 13 2016 :  16:30:29  Show Profile  Reply
I've tried to call DLL from Delphi, but it crashes, because it's not possible to pass classes (TIEBitmap) across module boundaries, except if
it's linked with dynamic RTL/VCL. In C++ it works flawless.

So, I've modified a DLL and all entries are of the same type. Only arguments
passed are two structures. All images are passed as an array of byte pointers to TIEBitmap scanlines.

Although I'm very clumsy with Delphi, I've managed to make SIFT/ORSA work (hurrah).

Beside that, any reference to VCLs are removed from DLL and it's size shrank to 1.4MB.

So, here is again SIFT/ORSA DLL (2.0) with demo exe in C++ (with source code), but this time with demo program in Delphi (source code only). It can load image (24 bit) and calculate SIFT descriptors.

Orsa.h header file was converted to ORSA.PAS file using Dr.Bob's converter wizard and then adjusted by hand...now this was pain in the....

attach/spetric/2016101316245_orsa_20.zip
3596.59 KB

More experienced Delphi programmers can check Orsa.h vs ORSA.PAS and eventually finish Delphi project that I've started.

Have fun,
Siniša

Once again, output images (panorama, reg1 and reg2) are created the same way as in IPOL online demo. I don't like the way panorama, reg1 and reg2 are created:

output.width = max(source.width, target.width)
output.height = max(source.height, target.height)

and then all output images are translated according to center of the new image, but I didn't want to modify original program. If I decide to make some kind of image stitcher, I'll modify the way output images are created.

Go to Top of Page

xequte

4143 Posts

Posted - Oct 17 2016 :  17:16:36  Show Profile  Reply
Nice job, Sinisa. It works very effectively.

I'll be playing with it more once I get on top of the mountain of emails that accumulated during my holiday.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

spetric

Croatia
221 Posts

Posted - Oct 26 2016 :  17:01:09  Show Profile  Reply
Hi Nigel,

There is a bug in DLL: inliners and outliners internal vector lists were not cleared, so when you load new src/target image inliners/outliners vectors data were cumulated (original code is console application, so there wasn't need for any clearing). Beside that I've added translate option (will the reg. images be translated to accommodate new "panorama" output or not). Translate option is added in structure/record (see orsa.pas).

Also, I've modified original image template so that color filling now works ok (I've set green color background in demo).

Here is the new DLL and demo prog. version:


attach/spetric/20161026165944_orsa_distrib.zip
3597.03 KB
Go to Top of Page

spetric

Croatia
221 Posts

Posted - Nov 16 2016 :  16:46:31  Show Profile  Reply
I'm rewriting my drawing engine (surface, geometry, drawing, filters, etc..) and here is a little "by product": a 2D Tessellation, including Voronoi diagram and Delaunay triangulation (including Gouraud shading). The source is in C++, but if there is substantial interest, I can pack complete engine (in it's present status) in DLL, so it can be called from Delphi.



Here is demo and source code:
attach/spetric/20161116163042_voronoi_distrib.zip
3225.39 KB

Significant parameters:
Number of sites - number of sites in last iteration.

Number of iterations - number of sites are divided by two for each iteration. Tessellation is made from the first level (iteration with smallest number of sites) and goes upward (number of sites are now multiplied by two).
New sites are added and new tessellation is performed.

Level error - for each level (iteration) every new site candidate, i.e. color (luminance) from previously tessellated image at x,y is compared to original image color (luminance) at x,y. if abs(siteLum - origPixelLum) is higher then given error, site is added, otherwise it's discarded. In such a way, areas with similar color are not tessellated (see the figure above - areas on the right side of the image).

NOTE: high number of iterations with high number of sites tend to be very slow (10 seconds and above).

Have fun,
Siniša




Go to Top of Page

xequte

4143 Posts

Posted - Nov 17 2016 :  20:00:55  Show Profile  Reply
Hi Sinisa

Nice work. It gives some really cool effects. I did not notice any particular performance issues, even with large images.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

spetric

Croatia
221 Posts

Posted - Nov 18 2016 :  06:54:34  Show Profile  Reply
Hi Nigel,

Glad you like it. However, it's little cumbersome, because when tessellation is performed, routine returns both voronoi edges and Delaunay triples, so there is no need to run it again and again when mode is changed or edges color is changed.

So, I've changed the logic and added few extra parameters:

1. Number of sites (end): number of sites in last iteration.
2. Number of sites (start): number of sites in first iteration.
3. Custom color: edge color can be picked from ColorBox.
4. Redraw: a button that performs various styles of output (once tessellation is done).

Iterations are simplified: first iteration is started with given sites number (2.) and for each subsequent iteration, number of possible sites is incremented until final sites number is reached (1.).

Also, I have added a possibility to save the image and fixed some bugs (Gouraud shading).

Here is the new version:

attach/spetric/2016111865312_voronoi_distrib.zip
3136.23 KB
Go to Top of Page

klausdoege

Germany
261 Posts

Posted - Dec 13 2016 :  11:43:20  Show Profile  Reply
Hi Spetric, this is a cool effect.
But how you now, i make all with delphi.
Is there a DLL available ?
regards
Klaus

Klaus
www.klausdoege.de
Go to Top of Page

spetric

Croatia
221 Posts

Posted - Dec 14 2016 :  06:35:24  Show Profile  Reply
Hi Klaus,

I hope that I'll finish the first version of DLL engine until the end of this week and make
a simple Delphi demo on how to use it.

Go to Top of Page

klausdoege

Germany
261 Posts

Posted - Dec 16 2016 :  16:38:07  Show Profile  Reply
Hi Spetric,
fine, i would be happy
regards
Klaus

Klaus
www.klausdoege.de
Go to Top of Page

w2m

USA
1957 Posts

Posted - Dec 19 2016 :  12:43:24  Show Profile  Reply
WPCubed PDF Plugin for ImageEn Demo
by William Miller/Adirondack
Full Source
Compiled with Delphi Seattle, but is expected to compile with Delphi 2010 or higher.
Price: Free

This demo shows how to use the WPCubed PDF Plugin for ImageEn.
The WPCubed PDF Plugin for ImageEn may be purchased here:
http://www.shareit.com/product.html?productid=300747111

The plugin is a third party plugin written for use with ImageEn.
The simple plugin allows editing pdf file frames as TIEBitmaps just like other supported file formats.

I found the instructions and the demos provided with the plugin was not correct and did not function which caused me to modify one of the demos to compile and function properly. I found that it was critical that the plugin is initialized in the initialization selection of the main form of each project that uses the plugin:
{ Initialize the WPViewPDF plugin }
  {$I PDFLicense.INC}
  initialization
  glWPViewPDF_DLLName := WPViewPDF_DLLName;
  glWPViewPDF_DLLName64 := WPViewPDF_DLLName64;
  glWPViewPDF_LicName := WPViewPDF_LicName;
  glWPViewPDF_LicKey := WPViewPDF_LicKey;
  glWPViewPDF_LicCode := WPViewPDF_LicCode;

  procedure TForm1.FormCreate(Sender: TObject);
  begin
    if TIEWPCubedPDF.Initialize then
      TIEWPCubedPDF.RegisterPlugin
    else
      MessageBox(0, 'PDF decoder DLL could not be found.', 'Error',
        MB_ICONERROR or MB_OK);
  end;

Make sure that the path to the WPCubed PDF plugin is added to the IDE's library path. This demo can open multiframe tiff or pdf files and shows how to convert pdf to tif files and how to export selected frames to a tif file.

The WPCubed PDF Plugin for ImageEn eliminates the need to install and use ImageMagick and GhostScript to add pdf file support to ImageEn. Previously my testing found it was not possible to get the frame count of pdf files using ImageMagick and GhostScript so it was not possible to load frames into TImageEnMView. Although not measured, the time to load pdf files was much faster with TIEWPCubedPDF than with ImageMagick and GhostScript.

The ability to convert selected frames to grayscale or Black and White was added to answer a question in the forum.

The WPCubed PDF Plugin for ImageEn is highly recommended for those developers requiring the ability to process PDF files with ImageEn.



Download: attach/w2m/20161219125045_WPPDF_Multi.zip
126.11 KB

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

Go to Top of Page

Fábio Nascimento

Brazil
53 Posts

Posted - Dec 19 2016 :  12:54:20  Show Profile  Reply
Hi,

I own a copy of WPDF, I use it to view PDF's inside my application.

Do I need to buy this plugin separetelly?

Can I view the PDF's within the ImageEnVect?

Thanks

Fábio
Go to Top of Page

w2m

USA
1957 Posts

Posted - Dec 19 2016 :  13:20:34  Show Profile  Reply
Probably Nigel can answer this question, because I do not own the full component. I suspect the full WPPDF component can be used because the plugin is a subset of the full component. I do not know how to achieve this with the full component however, but this does not mean it can not be achieved. Look at the documentation or wait for Nigel to reply.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

4143 Posts

Posted - Dec 22 2016 :  04:23:18  Show Profile  Reply
Hi Fabio

You need to ask Julian about WPDF. Some of the WP PDF products can be used, but I don't know that it is one of them.

You can view PDF's within ImageEnVect in the same way as ImageEnView.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

Fábio Nascimento

Brazil
53 Posts

Posted - Dec 22 2016 :  05:58:46  Show Profile  Reply
Ok cool, thanks guys! Merry xmas and happy new year to you all!
Go to Top of Page

spetric

Croatia
221 Posts

Posted - Dec 22 2016 :  17:16:29  Show Profile  Reply
Oh well, I really put an effort to build so-so Delphi demo for my drawing engine.

Engine is written in C++ and it's quite fast and lightweight (1.4MB).
I did not build x64 version, but it's not a problem. However, I want to do some more testing and probably some more changes before X64 version.

Also, I need to write a manual on how to use the engine (lot of parameters).
I'll write it down if there is an interest, of course.

Currently only draw-rendering is supported and some options are not exposed in demo program. I'm not "per tu" with Delphi and this was a nightmare for me (volunteers needed). It's a new drawing engine for my prog. Pixopedia and this is a dll version of the engine (almost the same parameters). You can use brush bucket (multiple brushes: speSetBucketIndex function) but it's not implemented in current demo. Setting palette functions are exposed, but not available in demo (you can add them). Demo is built with Devexpress trackbars and color combos, but you can replace them with any others. Initial image is white canvas and right mouse click on the image pops-up available shapes (polyline, polygon and spline are not yet in dll).



Here is dll, demo exe and demo source code:

attach/spetric/2016122217524_delphi_spe_demo.zip
6538.68 KB

Oh yes, I forgot. Currently engine's surface accepts only unfragmented TIEBitmpa(s): IEGlobalSettings().AutoFragmentBitmap := False;

It's not a problem to add a method that can accept fragmented bitmaps, but you'll have to pass an array of scanlines. Any image container that has scanlines or some kind of contiguous buffer with known stride can be passed to engine's surface.

@klaus
Sorry Klaus, I did not have time to put tessellation into engine.
I'm thinking of creating a new dll (it will depend on spEngine.dll) with various effects (tessellation will be the first one).

Go to Top of Page

yogiyang

India
478 Posts

Posted - Dec 22 2016 :  23:28:24  Show Profile  Reply
Hello spetric,

Are there any possibilities to drawing Strokes around marquee selection with one command provided selection exist....?

TIA


Yogi Yang
Go to Top of Page

spetric

Croatia
221 Posts

Posted - Dec 23 2016 :  02:39:09  Show Profile  Reply
Hi Yogi,

I think you mean something like this:



I have this option in Pixopedia and it can draw strokes around selection (actually it can draw strokes around multiple selections).
There is no difference between polyline/polygon drawing and selection drawing, as selection is polygon.

However, in this version of dll (let's call it 0.1) I did not implement polyline/polygon drawing (it's actually inside dll, but not exposed).

I will add it in next version (together with selection clipping).






Go to Top of Page

yogiyang

India
478 Posts

Posted - Dec 23 2016 :  23:07:55  Show Profile  Reply
Hello spetric,

Yes! that is exactly what I am talking about.

TIA


Yogi Yang
Go to Top of Page
Page: of 7 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To: