Recognize dark rectangles with Open CV - Node.js - node.js

I'm trying to do some image recognition using Open CV. I want to detect the position of a dark rectangle in a game called Diablo 2.
After detecting the position of the rectangle, I will extract the text of that rectangle using OCR.
I've prepared some examples using Photoshop of where are those rectangles located.
On the left you can see the game screenshot, on the right I've pointed out the dark rectangles using a red rectangle, that's the place I want to detect using OpenCV.
Which OpenCV method should I use to detect those dark rectangles?
I'm not sure if Open CV is capable of doing this kind of pattern recognition, would be great if anyone can point me out how to do it.

Related

Mesh color doesn't show in Maya UV editor

I am working with a face mesh in Autodesk Maya. To each vertex of the mesh, I assigned a specific color, using pycore.polyColorPerVertex function. I would like to see these same colors in the UV view as well, but they are not showing when I open the UV editor. I tried with different setups within the UV editor, but honestly, I have no experience in Maya, and I don't know how to solve this. Is there an (easy) solution?
Here goes a captureenter image description here if it helps..

Writing text on a curve in pygame

How do I write text like this over a curve like bezier, bspline etc. using pygame or python 3?
If you know the angles you want to display the text at, you could create images for each letter and then use pygame.transform.rotate on the letter to create a new, rotated image.
Pygame text functions are limited to monochrome text rendering in a straightline, using the font's hinting.
Cairo (and PyCairo) however, offer heavy duty drawing and text rendering APIs -
so you probably will have to learn how make your curved text in Cairo, and transfer the cairo image to a Pygame surface for your game.
There is a wiki page on how to transfer images between both here: http://pygame.org/wiki/CairoPygame - I am not sure if Cairo's API alone contemplates curved text, but it can render SVG - so you can create your curved text in SVG, render it in cairo, and paste it in Pygame.

get color on click texture three.js

(sorry for my bad english)
I'm using Three.js to create a panorama. I would like to know if it is possible to get the color of a texture which I clicked on?
For that, I already have created a sphere and I can get the 3D coordinates on the sphere where I clicked (using, raycaster, projection,...).
The texture on the sphere is a ".png" with transparency. The area I would like to detect is colored :
Could you help me?

Remove the picture edges

I downloaded a icon, and now i want to reset the color of it, but i'm not good at photoshop, i've set the color of it to be red, but there are to many edges and corners, please tell me how to remove those edges by using photoshop step by step, thanks a lot.
here is the icon i downloaded:
and this is my ugly one:
The best way to alter a single color like this on a simple image such as this is to alter the Hue and Saturation [CTRL / CMD + U]...
This allows you greater color control and keeps the anti-aliased edges of the image intact.
Most beginners alter colors like this by simply selecting the color with the wand, or using the paint bucket on the color. Unfortunately this usually does one of 2 things:
Makes the ragged edges that you saw.
Leaves a halo of the old color as an orphan.
I did this in a few seconds with that tool:

Ignoring touches on transparent areas cocos2dx

I have an image of size 480x800 pixels and there is a icon on one corner which I need to place. What I want is that to ignore all touches on the transparent areas and detect only the area where the icon is.
I found a solution in SO to this problem but it just tells the code to be used. I need to know exactly where to put that code since I am a beginner and don't know much about cocos2d so I expect a step by step solution.
Cocos2d 2.0 - Ignoring touches to transparent areas of layers/sprites
Do not use glReadPixels because it affected by bugs in android drivers. You can translate CCTouch to CCPoint in image coordinates using convertTouchToNodeSpace, and read image pixel at given point.
Create CCImage from file that contains semi-transparent picture, and read one pixel at tap point; it should be {0,0,0,0} for transparent area.
Don't forget to check that tap is not outside picture, and create pixel index in CCImage::getData() array with formulae unsigned index = x * imageWidth + y.

Resources