-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add overlay frame to webcam pane. is it possible to add frame to camera? or can i draw something on camera? else can i put image on webcam pane? #282
Comments
Hi @dhavaljoshi43, You can either draw some image on the panel ( The other possibility, where you modify the original image that comes with camera feed, is to use Depending on your needs you can choose one of the above. |
Second approach is suitable to me.. but how to draw frame on WebcamImageTransformer class? is it possible to do anything with that? can we set any image to this class? trasparent image like I mentioned above? |
Of course it is possible :) Have you take a look at the example from my previous post? This is very simple example that turns image into grayscale, but you can do with the image practically anything. More sophisticated example I crafted just before a minutes ago can be found here: I guess it does exactly what you are trying to achieve, so I will not explain how to use it - just take a look into the code. I guess it's fairy simple to understand. WebcamImageTransformerExample.java The effect: Take care! |
Awesome Man Awesome!! Right now I am not on my desk. I will implement tomorrow. then I get back to you. Thanks a lot for now! you have developed awesome API among all. All the best. Take care! Good Night. |
Hello Very Good Morning @sarxos. Using this code I captured image : BufferedImage image = selWebCam.getImage();
// save image to JPG file
ImageIO.write(image, "JPG", new File("/home/ubuntu/" + System.currentTimeMillis() + ".jpg")); problems in saving only in JPG format. If i used PNG then works Fine. |
Hi @dhavaljoshi43, The issue you are struggling is caused by the very fundamental difference between JPEG and PNG. The JPG consist of RGB channels, and PNG consists of ARGB (where A stands from Alpha). So it is very important to use appropriate Ok, now to the core of your problem. As I stated above, you need to use RGB instead of ARGB, so it's enough to change this: BufferedImage modified = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); Into this: BufferedImage modified = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); I will change the source code to eliminate the types dissonance. |
Thanks for labor. |
Thanks @sarxos now Its works perfectly!! thanks for help. |
@dhavaljoshi43, you're welcome :) @mehmetbektas, the live streaming example available under the link below works well (was tested on WinXP, Win7, Ubuntu 12 and 14). Please note it's not a reference implementation, just a POC (proof-of-concept), so in case you find any issue with the example code you have to fix it on your own. All dependency versions are available in pom.xml of this project. The Xuggler, as you can see, is http://xuggle.googlecode.com/svn/trunk/repo/share/java/xuggle/xuggle-xuggler/5.4/ Please also create a separate issue next time in case of questions not related the the original issue subject. I would like to avoid mixing topics that are not related, so we have everything organized and clear. Thanks. |
i have done it. thanks again |
Hello. I want to know if i want to capture image that is overlayed by one trasparent frame. transparent frame can be one image also. so When i click the photo there is frame in it? help to resolve my issue? kindly help me..

The text was updated successfully, but these errors were encountered: