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
 TImageEnProc.DoPreviews changes not applied

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
cbiasatti Posted - Nov 08 2016 : 13:18:14
Hi, I'm capturing video using a TImageEnView called img1, then overrided its DShowNewFrame as this:

procedure TdlgCaptura.img1DShowNewFrame(Sender: TObject);
begin
  // copy current sample to ImageEnView bitmap
  img1.IO.DShowParams.GetSample(img1.IEBitmap);

  // refresh ImageEnView1
  img1.Update;
end;


This displays the currently selected video source.

Now, I want to change RGB or HSL offsets. To do that I call img1.Proc.DoPreviews(), but when I close the preview window by clicking Ok the changed values are not applied to the image. How can I do what I want?.

Currently my code looks like this:

if img1.Proc.DoPreviews([peAll]) then
begin
  img1.IO.Update;
end;


Regards,
Claudio.
6   L A T E S T    R E P L I E S    (Newest First)
cbiasatti Posted - Nov 17 2016 : 10:43:47
Hi xequte,

Your suggest worked fine!
Thanks !


Code:


procedure TdlgCaptura.Capture;
var
  x : Integer;
begin
  x:= ImageEnMView1.AppendImage;

  ImageEnMView1.SetIEBitmapEx(x, img1.IEBitmap);

  ImageEnMView1.GetTIEBitmap(x).ChannelOffset[0]:= img1.IEBitmap.ChannelOffset[0];
  ImageEnMView1.GetTIEBitmap(x).ChannelOffset[1]:= img1.IEBitmap.ChannelOffset[1];
  ImageEnMView1.GetTIEBitmap(x).ChannelOffset[2]:= img1.IEBitmap.ChannelOffset[2];
  ImageEnMView1.GetTIEBitmap(x).Contrast:= img1.IEBitmap.Contrast;

  ImageEnMView1.GetTIEBitmap(x).FixChannelOffset;

  ImageEnMView1.GetTIEBitmap(x).FixContrast;

  ImageEnMView1.Update;

end;
xequte Posted - Nov 14 2016 : 14:58:25
Hi

You can use IEBitmap.FixChannelOffset(); to permanently apply your ChannelOffsets. Of course, if you do it ImageEnView1.IEBitmap then they will be applied to the displayed image (until the next frame is loaded via DShowParams.GetSample), so you may want to do it to a copy.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
cbiasatti Posted - Nov 14 2016 : 13:08:27
Hi xequte, I think I'm getting closer. Now I'm changing Channels using this:

ImageEnView1.IEBitmap.ChannelOffset[0] := tbRed.position;
ImageEnView1.IEBitmap.ChannelOffset[1] := tbGreen.position;
ImageEnView1.IEBitmap.ChannelOffset[2] := tbBlue.position;
ImageEnView1.Update;


This updates the video preview in real time.

Now I want to create a thumbnail of the current frame. To do this I do:

x := ImageEnMView1.AppendImage;
ImageEnMView1.SetImage(x, ImageEnView1.Backbuffer);


This creates a thumbnail of ImageEnView1, BUT using the viewing size (stretched) and not the real captured size of the video.

If I change that code to this:

x := ImageEnMView1.AppendImage;
ImageEnMView1.SetIEBitmap(x, ImageEnView1.IEBitmap);

The stored thumbnail has the correct size, but does't preserve the channeloffsets.

Is there a way to copy the image without stretching it and also preserving the channel offsets?.
xequte Posted - Nov 11 2016 : 16:02:31
Hi

If you display the Previews dialog, then you can use ImageEnView1.Proc.IPDialogParams to see what settings the user applied.

http://www.imageen.com/help/TImageEnProc.IPDialogParams.html

You can then apply the effects yourself, e.g.

procedure TdlgCaptura.img1DShowNewFrame(Sender: TObject);
begin
  // copy current sample to ImageEnView bitmap
  img1.IO.DShowParams.GetSample(img1.IEBitmap);

  with img1.Proc.IPDialogParams do
    img1.Proc.HSLvar( HSL_H, HSL_S, HSL_L ); 

  // Note: Don't need to refresh if used img1.Proc
  // img1.Update;
end;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
cbiasatti Posted - Nov 09 2016 : 06:56:17
Hi Nigel, thanks for your answer.

What I need is a way to setup some RGB/HSL and Brightness/Contrast
values for the video source, nothing more than that. How can I do that?.

Claudio.
xequte Posted - Nov 09 2016 : 03:35:10
Hi Claudio

Previews and image effects only apply to the image that is currently loaded. As soon as you call "img1.IO.DShowParams.GetSample(img1.IEBitmap);" it replaces the current image (IEBitmap) with a new one from DShowParams.GetSample.

You would need to apply the effect after each "img1.IO.DShowParams.GetSample(img1.IEBitmap);" call, but that would probably have too adverse an effect to performance.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com