I'm creating an app using ionic2 where it should detect the face and blur it. how can I do that? I checked OpenCV, ImageMagick & GraphicsMagick nothing helped!!
I beleive OpenCV has face detection and I would then create a copy crop to the face area. Shrink and then scale back to original size. Put the pixelated image back over the original.
Related
I've got a texture I'm using in OpenGL 4.6 that I want to scale to 2x2, but I'm not sure how. Is there any way to resize an image in a way so that each pixel in the original image is basically duplicated to create a 2x2 in the resized image? I've tried using photoshop to do this, but the image quality always seems to drop significantly. Or do I have to manually create the image myself?
I'm using Opencv extract the finger vein from a camera, first I use the GaussianBlur to smooth the image and then use the adpateThreshold to get the binary image, but the result isn't good, because the camera has a lot of salt noise and it made each frame are difference(for the brightness), the binary image is very unstable(I also tried the medianBlur but the result isn't good too), so I think to extract the vein from camera can't simply use the threshold method. could anyone give me some suggestion about how to extract a clear and stable finger vein by using opencv?
thanks a lot.
Photo here
I make a sprite in cocos2dx c++ as.
CCSprite *mysprite=CCSprite::create("mysprite.png");
this->addchild(mysprite);
But as we all know this comes in a rectangular shape.If there a way to crop dynamically or to create a sprite in a circular shape knowing that the .png file is in rectangular shape.
Can we crop or create a sprite that take the .png and cut it as a circular shape.Are there any links or tutorials regarding this issue.
I am using cocos2dx 2.2 version
I am attaching two images of what i exactly want
Any help will be highly appreciated.
Thanks
Update (7-25-14)
I can't really recommend CCMask anymore, considering that it is for v2.x and cocos2d-x is moving quickly with the v3.x branch. It's wisest to go with the built-in ClippingNode.
Original answer (4-19-2014)
One option is CCMask. Its interface is simpler than ClippingNode so you can get up and running faster.
From its readme:
// Create a mask and an object
CCSprite* mask = CCSprite::create("mask_circle.png");
CCSprite* object = CCSprite::create("HelloWorld.png");
object->setPosition(ccp(mask->getContentSize().width/2, mask->getContentSize().height/2));
// Create a masked image
CCMask* masked = CCMask::create(mask , object);
masked->setPosition(ccp(size.width/2, size.height/2));
this->addChild(masked);
I want to use a full color PNG image as a particle in cocos2d with an emitter designed in ParticleDesigner.
I dragged in the image I want to use and set-up everything how I want it in ParticleDesigner and it looks good.
Problem is when I import into cocos2d, the particles appear to have grey squares over them (a small bit of the yellow image is visible on the side, but they gray covers the rest including transparent areas).
Code:
CCParticleSystemQuad* particleSystem = [CCParticleSystemQuad particleWithFile:#"coin magnet.plist"];
particleSystem.position = ccp(320, 320-16);
[self addChild:particleSystem z:1000];
I'm guessing it might be an issue with blending options...
I've tried GL_SRC_ALPHA to GL_SRC_MINUS_ALPHA (set by the normal button in ParticleDesigner), additive combinations, and trying different things with GL_ZERO and GL_ONE
Why are the particles appearing grey? Does cocos2d support using full color images as particles?
Figured it out!
Turns out the image didn't embed properly in the plist (bug in ParticleDesigner) so that's why it was appearing grey.
Exporting with the png separate solved the issue.
And yes, you can definitely use color images as particles in cocos2d!
I am using cocos2d for a game which uses sprite sheets for my character animations. I created these images using TexturePacker. Now, I want to use PVRTC 4 format for reducing memory consumption due to some reasons. But as the PVRTC Texture Compression
Usage Guide suggests, I need to add extra border of 4 pixels in each character to produce proper results. Even if I add border, I will have to mask this image with alpha image to remove border at run time. I am using Texture Packer to create a sprite sheet with PVRTC4 format and created alpha masking image matching it. I am ready with these 2 images in hand which are of same width and height.
Now my question is, how can I mask my PVRTC texture with alpha image in Cocos2D?
It will be more helpful if the solution provided works with Batch Nodes!
Thanks in advance for any solutions!
Why don't you just make the border/padding area completely transparent?
I was having the same problem, and after reading ray wenderlichs page about masking, I made a little ccsprite subclass which allows you to mask by 2 images.
CCMaskedSprite