i want to blur Whole image and display circle or rectangle area on image.
with move the circle and rectangle on image.save the blur image without circle and rectangle.
Related
I have an image with a bright center but dark edges. I need to draw rectangle at a certain brightness, so that the darker areas remain outside. Or get the coordinates of this frame. Preferably using OpenCV, the programming language is not important.
I am trying to implement a metal-backed drawing application where brushstrokes are drawn on an MTKView by textured square repeatedly along a finger position.
I am drawing this with alpha 0.2. When the squares are overlapped the color is added. How can I draw with alpha 0.2.
I think you need to draw the brush squares to a separate texture, initially cleared to transparent, without blending. Then draw that whole texture to your view with blending.
If you draw the brush squares directly to the view, then they will accumulate. After you draw square 1, it's part of the image. Metal can no longer distinguish it from anything else that was already there. So, when you draw square 2 overlapping it, it will blend with what's already there, including square 1.
The perimeter around a circle gets pixelated when scaling down the image.
The embedded circle image has a radius of 100 pixels. (The circle is white so click around the blank space, and you'll get the image.) Scaling down using SpriteKit causes the border to get very blurry and pixelated. How to scale up/down and preserve sharp borders in SpriteKit? The goal is to use a base image for a circle and create circle images of different sizes with this one base image.
// Create dot
let dot = SKSpriteNode(imageNamed: "dot50")
// Position dot
dot.position = scenePoint
// Size dot
let scale = radius / MasterDotRadius
println("Dot size and scale: \(radius) and \(scale)")
dot.setScale(scale)
dot.texture!.filteringMode = .Nearest
It seems you should use SKTextureFilteringLinear instead of SKTextureFilteringNearest:
SKTextureFilteringNearest:
Each pixel is drawn using the nearest point in the texture. This mode
is faster, but the results are often pixelated.
SKTextureFilteringLinear:
Each pixel is drawn by using a linear filter of multiple texels in the
texture. This mode produces higher quality results but may be slower.
You can use SKShapeNode which will act better while scale animation, but end result (when dot is scaled to some value) will be almost pixelated as when using SKSpriteNode and image.
I have images in rectangle shape. When I use them in CCSprite, they are displayed as in Rectangle shape. But I want to change the shape of rectangle to circle and that circle image should be set in to another circle sprite. As displayed below.
Here, chicken original image is in rectangle shape and another chicken border image is circle. I want that chicken original image to be displayed in circle shape and after fit in to chicken border image that's circle.
i also check link
you will need to use box2d with cocos2d.
please check the link blow:
http://www.codeandweb.com/blog/2011/06/16/using-texturepacker-and-physicseditor-together
In OpenCV, i know how to draw circles, but is there a way to get back all the points that makeup the circle? I hope I dont have to go through calculating contours.
Thanks
If you know how to draw the circle,
Create a black image with the same size of as that of original image
Then draw the circle on the black image with white color
Now in this black image, check the points which are white
If you are using Python API, you can do as follows :
import numpy as np
import cv2
img = np.zeros((500,500),np.uint8)
cv2.circle(img,(250,250),100,255)
points = np.transpose(np.where(img==255))
You can do similar thing to the answer implemented in python in C/C++
If you know how to draw the circle,
Create a black image with the same size of as that of original image
Then draw the circle on the black image with white color
Now instead of checking which pixels have certain value you can find a contour (represented as vector of points) of the circle's edge.
To do this you can use OpenCV's findContours function which will give you the points on the circles edge.
Actually the background doesn't have to be black and the circle white, but the background should be plain and the circle should have different color than background.