ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 pencil sketch making

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
exchangeviews Posted - Aug 17 2014 : 08:56:38
Hi All,

Is there a way to convert image into sketch using imageen? Any help appreciated.

3   L A T E S T    R E P L I E S    (Newest First)
spetric Posted - Aug 21 2014 : 00:37:14
Hi,

you can obtain such type of sketching using some ImageEnProc methods.
Let's say that ienProc is TImageEnProc instance and your image is attached to ienProc, then (c++ code):


ienProc->ConvertToBWOrderd();  //convert to BW by dithering ordered
ienProc->RemoveIsolatedPixels(0, 5); // remove black isolated pixels (max 5 grouped)
ienProc->RemoveNoise(1, false); // remove noise, 1 iteration


If you want to enhance contour, prior to converting image to bw, create contour from image, invert it and then overlay contour over converted image (or use it as a mask for border enhancement).

Regarding ImageMagic, it's actually command line, batch processing software. You can call it from your application, either as a shell command, or through desired programming language interface.

I'll try (probably this autumn) to write some wrapper class in order to be able to execute ImageMagic scripts using ImageEnView->IEBitmap as referent source image (saving it as temporary file or binary stream, performing IM script and loading it back to viewer).

exchangeviews Posted - Aug 18 2014 : 09:41:44
Thanks for reply. But can I create sketch as shown in image instead outline either by using imagemagick.dll along with imageen.



Thanks in advance.
w2m Posted - Aug 17 2014 : 11:20:22
Here are two ways that works ok with simple images:

procedure TForm1.EdgeDetect1Click(Sender: TObject);
{ Perform an edge detect using Sobel filter }
begin
  ImageEnView2.Assign(ImageEnView1);
  ImageEnView2.Proc.SaveUndo();
  { Perform an edge detect using Sobel filter }
  ImageEnView2.Proc.EdgeDetect_Sobel;
  { ConvertToBWThreshold to make result black/white (with 1=edge) }
  ImageEnView2.Proc.ConvertToBWThreshold(-2);
  ImageEnView2.Fit;
end;

procedure TForm1.EdgeDetect2Click(Sender: TObject);
begin
  ImageEnView3.Assign(ImageEnView1);
  ImageEnView3.Proc.SaveUndo();
  { EdgeDetect_ShenCastan converts the current color image to black/white
  (1 bit) with a Shen-Castan (ISEF) edge detection algorithm.

  Shen-Castan algorithm convolves the image with the Infinite Symmetric
  Exponential Filter, computes the binary Laplacian image, suppresses false
  zero crossing, performs adaptive gradient thresholding, and, finally, also
  applies hysteresis thresholding. (Algorithms for Image Processing and
  Computer Vision - J.R.Parker).

  procedure EdgeDetect_ShenCastan(Ratio:double; Smooth:double; WindowSize:
    Integer; ThinFactor: Integer; DoHysteresis: Boolean);
  Ratio: percent of pixels to be above High threshold (suggested 0.99)
  Smooth: Smoothing factor (suggested 0.9)
  WindowSize: Size of window for adaptive gradient (suggested 7)
  ThinFactor: Thinning factor (suggested 0)
  DoHysteresis: If True turn on the hysteresis thresholding (suggested True) }

  ImageEnView3.Proc.EdgeDetect_ShenCastan(0.99, 0.9, 7, 0, True);
  ImageEnView3.Fit;
end;




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