Author |
Topic  |
xequte
    
37914 Posts |
Posted - Oct 17 2016 : 17:16:36
|
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.

Note: Homography is now included in ImageEn+IEVision. See the demo: \Demos\IEVision\ImageAlignment\ImageAlignment.dpr
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
 |
|
spetric
  
Croatia
308 Posts |
Posted - Oct 26 2016 : 17:01:09
|
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 |
 |
|
spetric
  
Croatia
308 Posts |
Posted - Nov 16 2016 : 16:46:31
|
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
|
 |
|
xequte
    
37914 Posts |
Posted - Nov 17 2016 : 20:00:55
|
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
|
 |
|
spetric
  
Croatia
308 Posts |
Posted - Nov 18 2016 : 06:54:34
|
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 |
 |
|
klausdoege
  
Germany
387 Posts |
Posted - Dec 13 2016 : 11:43:20
|
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 |
 |
|
spetric
  
Croatia
308 Posts |
Posted - Dec 14 2016 : 06:35:24
|
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.
|
 |
|
klausdoege
  
Germany
387 Posts |
Posted - Dec 16 2016 : 16:38:07
|
Hi Spetric, fine, i would be happy regards Klaus
Klaus www.klausdoege.de |
 |
|
w2m
   
USA
1990 Posts |
Posted - Dec 19 2016 : 12:43:24
|
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
Note: ImageEn now also supports PDF loading via the PDFium plug-in
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development
|
 |
|
xequte
    
37914 Posts |
|
Fábio Nascimento
 
Brazil
72 Posts |
Posted - Dec 22 2016 : 05:58:46
|
Thanks for the demo, Bill! Merry xmas and happy new year to you all! |
 |
|
spetric
  
Croatia
308 Posts |
Posted - Dec 22 2016 : 17:16:29
|
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).
|
 |
|
yogiyang
   
India
725 Posts |
Posted - Dec 22 2016 : 23:28:24
|
Hello spetric,
Are there any possibilities to drawing Strokes around marquee selection with one command provided selection exist....?
TIA
Yogi Yang |
 |
|
spetric
  
Croatia
308 Posts |
Posted - Dec 23 2016 : 02:39:09
|
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).
|
 |
|
yogiyang
   
India
725 Posts |
Posted - Dec 23 2016 : 23:07:55
|
Hello spetric,
Yes! that is exactly what I am talking about.
TIA
Yogi Yang |
 |
|
klausdoege
  
Germany
387 Posts |
Posted - Dec 27 2016 : 12:48:40
|
Hello Spektric, Unfortunately, I can not test the demo, the TCX components are missing. But it looks very promising.
Klaus www.klausdoege.de |
 |
|
spetric
  
Croatia
308 Posts |
Posted - Jan 11 2017 : 16:09:53
|
I've built a new version of the spEngine (32 and 64-bit). There are lot of changes and additional functions, such as drawing ellipse/rectangle/polyline/polygon programmatically. All objects (including ellipse and rectangle) can be rotated by given angle.
I even wrote a manual (PDF), partially, because in the next version there will be some changes in structures, but not the parameters already in use. To avoid usurping the space on ImageEn forum, you can download the library from my site:
http://www.sigmapi-design.com/archive/spEngine.zip
Library is free but donations are welcomed
|
 |
|
w2m
   
USA
1990 Posts |
Posted - Jan 12 2017 : 14:28:35
|
I am studying the new spEngine demo. I find that nothing is drawn in OnMouseDown. I am using a solid brush. It seems like a single solid ellipse should be drawn in OnMouseDown, but it does not. Does your demo draw a single ellipse in the OnMouseDown event?
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
 |
|
spetric
  
Croatia
308 Posts |
Posted - Jan 12 2017 : 14:53:31
|
Hi Bill,
In demo program, in OnMouseDown event nothing is drawn, because both ellipse radius are 0:
PaintView.ObjLeft[_hobj] := X;
PaintView.ObjTop[_hobj] := Y;
PaintView.ObjWidth[_hobj] := 0;
PaintView.ObjHeight[_hobj] := 0;
OnMouseDown event is used to prepare ellipse for drawing and temporary iekEllipse object is created.
In OnMouseMove event, you actually "stretch" the ellipse:
rect.left := MouseData.X_down;
rect.top := MouseData.Y_down;
rect.right := MouseData.X_move_to;
rect.bottom := MouseData.Y_move_to;
rect.NormalizeRect;
PaintView.ObjLeft[_hobj] := rect.left;
PaintView.ObjTop[_hobj] := rect.top;
PaintView.ObjWidth[_hobj] := rect.Width;
PaintView.ObjHeight[_hobj] := rect.Height;
In OnMouseUp event iekEllipse object is removed and rendering is performed according to given parameters. |
 |
|
w2m
   
USA
1990 Posts |
Posted - Jan 12 2017 : 14:58:35
|
I am using a solid brush, not an object.
Shouldn't this draw?
if AShapeType = px_shpFreeHand then
speHandMouseDown(Shift, X, Y) <<==== Draw Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
 |
|
Topic  |
|