how to extract x,y coordinates from dots on an image - coordinates

I have been searching on youtube and google but still haven't found anything that fits my question or that I don't understand. Does anyone know how to extract coordinates from dots on an image (what program is best and/or how to do it). When looking at the image, you can see some black dots that can differ per image. I would like to extract the x,y coordinates from all the black dots as a coordinate system with the 0 point in the middle (surrounded by the red circle).
Thank you in advance!
The image with the black dots

Related

How to get image coordinates and color data per pixel clicking on a displayed image?

I loaded several PNG files into Matlab and displayed them with no problem but was wondering if there is a way to point (or click) on a pixel and immediately get its pixel coordinates and color (RGB), in real time, either as an output on-screen or stored in some variable.
For example, I have a 64 x 64 face photo to serve as a ground truth image for an eye detection algorithm. The algorithm will return the bounding box for an eye, but, to check it, I want to manually extract coordinates by clicking or mousing around the image as it is plotted, and also color information about the pixels on which I click or mouse.
Please feel free to suggest another language, software, or environment if Matlab does not support such interactivity.
Thank you for your help!
The Data Cursor does exactly what you want:
http://www.mathworks.co.uk/help/matlab/creating_plots/data-cursor-displaying-data-values-interactively.html
It is the icon to the right of the "rotate" icon in the image toolbar.
If you have the Image Processing Toolbox, there is a built in tool called impixel, which will allow you to click on an image and get pixel values and location automatically. There is no data cursor that pops up, but what the data cursor is returning, impixel is also, and you could easily display this with a uicontrol (text).

How can I extract only the white pixels from a UIImage?

I need to use some existing images with some white icon glyphs inside them and extract only the glyph part . Imagine the iPhone's Phone.app icon, which is green around, and has a white telephone icon in the middle. I would need to extract only the telephone icon, without the green background (and keep a transparency around it) .
I tried using CGDataProviderCopyData and iterate through the pixel values and change them,
but I am not familiar with graphics techniques and I had no luck.
Any help would be appreciated.
Do you have a fixed amount of images that you want to extract the while glyphs from or is it going to be continuous?
If its a fixed amount then that's a job for photoshop and not a question for here. If its for a stream of continuous images then I would suggest looking at the pixel values again.
A white pixel is (255,255,255) if you want to include near white pixels in your search you could include any pixels above a certain threshold. For example any pixels with all three values above 230.
So.. (<230,<230,<230)
Hope this helps :)

How to trace the intersection of an image with the boundaries of an irregular shaped image in cocos2d?

I have an image of mountain with small gutters and tunnels in it. I want to pass a small image through that tunnels. How to trace the intersection of that small image with the exact boundaries of large image in cocos2d?
I would make a collision mask for this.
What this means is to create an exact copy of the image you are using for your terrain except make it only two colors: white and black.
Make the areas that you want the player to be able to move through (not walls) white. Make the walls and anything you want the player to collide with back. Next, just do some pixel collision detection. To do this, I would get the RGB (not RGBA because alpha doesn't matter) data. Loop through this data (or a section of it for better performance) and detect whether or not the player is on a black or white pixel.
Do whatever you need to accordingly.
If you need more help, feel free to ask.

How can i paint inside the bouandry of the PNG image

I have an PNG image with complete transparency. It has a picture of an animal , just bordered with black color.
Now , I want to paint the image as my finger move on the ipad Screen, but paint should only appear inside the bordered region not out side.
My Thinking -----
What i am thinking is to keep the color of the image inside the boundary line, a little bit differ from the out side. Then, Get the pixel of the image and for each pixel , the color component.
Keeping all the pixels of out side the boundary in an array and check for it when finger move on the iPad screen.
I am new to the concept of core graphic and open GL so not being able to think wisely. Please help.
First you should define where is "inside" to paint on your image.
I suggest to run a flood fill algortihm on the first touched place and define de desired "inside area" pixels. Notice that you will run the flood fill at the background on the original black and white image, not for actually painting the pixels, just to figure out the target ones.
For example; we want to paint the animals face and body to different colors. When user first toucehs the face and drags over, you can do a flood fill on black and white image to find the pixels of the face and only paint the intersection of the face area and the touched area. Then, when the user picks up her finger (changes the color) and retouches on the body and you do another flood fill operation to detect the pixels of the body and so on.
It was a long description, hope it makes sense.
Here are some flood fill sources that might help:
Floodfill in objective c
https://stackoverflow.com/questions/8121348/flood-fill-algorithm-objective-c-version
How to Implement FloodFill Algorithm in iphone

Iphone App Color to black&White Image RGB Value

Currently i am working on Iphone app similar to http://itunes.apple.com/us/app/color-splash-free/id385504846?mt=8 in which we can make some or full portion of pic as black and white.
Please check the attach image for more detail.
I just want to know that how i can start it.I am familiar with paint app.Is this any rgb Value of any color or Its gray scale overlapping of an image with actual image at background or hide some portion of actual image and show grayscale image in that part.
Please share any code if you have that.
Thank you
Can't offer a concrete answer but a general approach from doing something similar.
What you have in 32 bit image is 4 channels of pixel information: red pixels, green pixels, blue pixels and alpha value for each pixel.
A gray image as you know from using any paint program is when all three colour components red, green and blue have equal intensity value.
E.g.
rgb value of (0.5,0.5,0.5) would be halfway between black and white.
What I can suggest is you looking into finding where the user tap the screen, take rectangular sample of pixels from the touch point into memory loop through all the sample pixels and set their red, green and blue value to be equal, then redraw the newly modified image onto the view again.
If you want to quickly convert an entire image to grayscale, you can use GPUImageFramework by Brad Larson? (apologies if I misspelled your name Brad :P).
You can use his GrayScaleFilter class to generate a grayscale image.