Is it possible to select two points automatically from an image?

I need to select only two points(coordinates) automatically marked with red crosses in the image titled "InkedCscan_Depth_1.3455". If this is not possible I would like to extract the lines as we generally see in plots (.fig format)
The angle in the image shows the orientation of the lines I want to inspect
I need help please

Risposte (2)

Information can only be automatically extracted if there is a programmable rule that describes how to distinguish the information from the rest of the data.
I see nothing in that image that would permit you to pick those particular points as being distinguished. I have no idea how you choose them.
The image appears to be similar to texture of a fabric. If you are trying to detect the "threads" then you might possibly be able to use houghlines . It would not astonish me if you had to "invert" the image so that the "thread" positions were bright and the holes were dark.

2 Commenti

Thank you for your reply. Can you show me an example please? That will be of much help
You might want to start with rgb2gray followed by imbinarize with 'ForegroundPolarity','dark' in order to produce the black and white image.

Accedi per commentare.

Explain why those two particular lines were picked? I see nothing special about them or any different than any other point in the image. You might look at radon to get a projection of your image at all angles to look for the angle where most of the lines are along.

10 Commenti

What I need is to write a function or code that can automatically select two coordinates from the visible lines in the image. My point is if I can get two coordinates from the lines visible in the image I can find the slope
Sounds like you didn't even try my suggestion. Probably you require something super simple.
How about if you just use something like improfile to define the angle manually? Why does it have to be automatic? You might spend less time manually drawing lines on your images than it takes to you write an automatical algorithm that is robust.
Does "What I need is to write a function or code that can automatically..." mean that it's your homework and we're not allowed to write it for you?
I'm attaching another demo where I get the angles in the image automatically. I get a "theta" image where every pixel is the local angle. Then you can take the average over the whole image if you want the global average.
thank you for your reply. I used getpts command for doing it manually earlier. Now I am trying to automate the process and couldn't find out the process even after a month of trying. I was trying the haughlines commented previously by another altruist and would have tried and read your process next. I will try both of your process
Thanks again
What guidelines did you use to manually select those two particular points ? When Image Analyst or I look at your image, we do not notice anything special about those two particular points.
I selected two random points from any visible lines. It doesn’t need to be the same two points rather it can be different ones as I am selecting manually.
My concern was if these two points can be located automatically from any visible lines at that angle to find out the slope
I assume you got it working.
If not, attach the original, not pseudocolored, non-annotated gray scale image and I'll work a few minutes on it if I get time.
Thanks for your concern. This is the original image. I have several of these kinds with different angles
I couldn’t solve with the methods you mentioned earlier. I think finding the points automatically without any hint is quite problematic. I might have to look other options. These images are extracted with code using ultrasonic test data.
Sorry, but no it's not. You have not attached any additional images, only the one in the original post up top. The original image will not be a screenshot. It will not have tick marks, axes labels, red X's, theta, etc. like the image you attached has. It will be just a plain gray scale image.
Got it. I will try to get the image. I appreciate your efforts. Let me try myself a few more days with the methods mentioned earlier.

Accedi per commentare.

Richiesto:

il 3 Feb 2023

Commentato:

il 5 Feb 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by