Put marker on the image in OpenCV - opencv

I'm showing an image using cv::imshow("binary1", binary1);. I want to put a marker on the image to the check the pixel locations. How can I put marker on the image for a particular row and column value?

It's difficult to understand what is it that you want to do, but I wrote a code a while back that displays the RGB color of a pixel along with it's coordinates on the title of the window. Move the mouse pointer over the image and you'll see it change.
It uses a Qt window, though. You can check cvImage.

Related

UIButton with a custom asymmetric clickable region?

I have an image with various asymmetric regions, is it possible to place a button above each region?
The image will be something similar to this: https://cdn.dribbble.com/users/1557638/screenshots/4367307/proactive_d.png
After way too much research, I’ve decided to go with following solution for an image with multiple asymmetric clickable regions:
Duplicated the image file, colored each region with a different color, and stored as an asset.
Placed a simple tap gesture recognition over the displayed image. When tapped, I get the relative coordinate to the displayed image.
Get the color from the map image at the tapped coordinates.
Compare to a predefined enum.

Detect text in a scanned page

I'm trying to detect the text in a scanned page and get the coordinates of it.
See the attached image for an example of scanned page.
I need the vertical coordinates for spliting page from the useless parts, and then detect the text's coordinates.
What kind of tools could I use to split and detect text's coordinates?
Take a look at the Stroke Width Transform.
See also this SO answer.

Getiing BGR values by clicking a particular location of an image

Is there any method in Opencv using which when we click on a particular location of an image, it gives pixel location as well as B,G,R values. Thank You!
There is an answered similar post here.
Basically, you need to use setMouseCallback() and create your own callback function.
You can start from here to get the mouse location: http://www.wisegai.com/2012/10/29/using-mouse-callbacks-with-opencv-and-the-cvhighgui-module/
(I don't know in which coordinate system will be the click, i.e. of the window, of the image or of the screen)
And these might help for the second part.
How to read the screen pixels?
Screen Capture Specific Window
In term of coordinates it might have an impact the window frame, you'll have to try or google a little bit further.

Fill image with different color by detecting the different parts

I have an Image of a landscape which i need to fill with different colors.
When i select colors from palette and start scrubbing on any particular part, only that part should get the color even if by mistake i take my finger outside of that image part.
So basically i need to detect which part of image have i tapped so that only that part takes the color.
I am developing this app in Cocos2dx, but any help in logic would be a good point to start.
Here is an example of what i want.
Note : I know i could achieve this by taking separate images and then detecting touches, but that increases the app size by alot of MB's.
I guess user will be able to draw only on white part of the image.
If above is true, what i want you to do is, in your touchesMoved method, check if any black color (non white) pixel is present between previous touch point and current touch point.
If there is no such black pixel, then draw it else dont draw it.

Fire Monkey Image view area

I want to create simple 2d racing game on FM, I have track (racing map) bitmap. Image component must show only part of that bitmap depending on car position. Is there any way to define coordinates of bitmap's start point, from which Image will show this bitmap. If Image doesn't support that, what component does? Thanks.
Use a TSubImage. This component is similar to a TImage, but lets you specify a sub-section of the image to be displayed.

Resources