Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to detect the lines that can't be checked by eyes?

Status
Not open for further replies.

tang76

Junior Member level 1
Joined
May 7, 2009
Messages
19
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,435
Dear all,

I need to detect two lines in the picture but the left line can't be checked by eyes sometimes. I attached two pictures, 1.jpg is the one that the left line can't be checked by eyes, and we can check the left line in 2.jpg.

I have two questions:
1) the interested part is inside the ellipse, how can I detect this area and pick out that part of image (the rectangle area)?
2) how to detect the location of left line?

Thanks,
Tang Laoya
 

Attachments

  • 1.jpg
    1.jpg
    9.4 KB · Views: 112
  • 2.jpg
    2.jpg
    9.5 KB · Views: 104

Hi Tpetar,

Thanks for your kindly reply. I need the method of solutioin. For example, some matlab functions and code to do it.

Thanks,
Tang Laoya
 

What kind of data have you got? Is it jpg or something else? I'm asking, because maybe You've got more data than You think, and your monitor cannot display it properly. Try to enhance contrast locally. If You want to select your region of interest try edge function in matlab.
https://www.mathworks.com/help/images/ref/edge.html
Alse, You can use the gradient method to select the edges in specific direction (in your case from left to right). If You have RGB image try to find the best channel to analysis. Probably it will be blue.
 

Hi cherryman,

Thank you very much for your kindly reply. It's the jpg format. Now the problem is that we require to check the left line even when the signal is small and the image quality is poor. For the 1.jpg, when I use edge funciton of matlab only the right line left.

Now my first problem is to detect the rectangle area lies inside the ellipse, do you have any good idea?

Thanks,
Tang Laoya

- - - Updated - - -

Hi 123jack,

I am reading the thread you suggested.

Thanks,
Tang Laoya
 

Hi tpetar,

Thank you very much for your kindly reply.

The lines are not always on the same place. The size of ellipse area could also be different.

Currently I have only these two pictures for comparison, maybe I can get more pictures, but the are similar.

Thanks,
Tang Laoya
 

1) imaging needs brighter emission, longer duration to increase sensitivity and smaller aperture to increase depth of field because it is out of focus.
2) Convert from raster to vector using math program or imaging program such as Corel draw.
3) The vector datafile can be used to compute the area.
 

Hi SunnySkyguy,

Thank you very much for your kindly reply.

for 1), I think it's the problem to improve the picture quality from hardware and it is not decided by me:(

Could you please give me more details on how to convert from raster to vector by math program?

Thanks,
Tang Laoya
 

from Shannon's Law one can correlate the probability of error and the SNR. You image has a negative SNR where you need at least 6dB or 2:1 SNR in contrast ratio for reasonable results.

Probability of error is too high. Get those responsible to fix step 1. Then Step 2 is possible with PSP or Corel, I would not try doing matrix pixel reduction to decimate the edges until you can master with the high level programs, then emulate if possible.
 

of course you might be able to just look for purple pixels ?
 

Hi 123jack,

Thanks for your kindly reply.
Not just for purple pixels. The goal is to check whether there is an approximate width line at left side inside the ellipse. Color of lines could be different according to different experiments.

Another problem is that there could be some distrubs to the program: when there are some stains inside the region (see the attached picture), the program can't get error results to say that it found the line.

Thanks,
Tang Laoya3.jpg

- - - Updated - - -

Another kind of fake information is that a curve lies at the left side (see attached picture). I am trouble in checking in these fake information, such as stains, curve lines.

Suppose I have got the rectangle region, I can find the location of true or false line (stain, curve line, etc.) by finding the peak of mean of gray value along y direction. However, I don't know how to recognize the true line. Do anyone have any good suggestion?


Thanks,
Tang Laoya

4.jpg
 

Hi Tang

Look for sobel edge detection as a starting point (its very much a staple).

As someone mentioned above - talk to whoever generates the image to ask them if they can standardise every aspect of it as much
as they can. This is always the first step as it reduces complexity of coding the most. They may not help but do ask.

I know the thread I pointed to is a bit long but the problem discussed is in effect the same as your own.
The solutions and methods are just the same but your problem is far easier than a random fracture.

What I'd do is:
Start by defining the range of different results and identifying what factors will always be present - those are what you look for.
Then think about how you could mask out everything you don't want
Then think about how software could find what you do want.

Off the top of my head looking at the couple of samples provided the first thing I'd do is mask out the right half of the image
then (because colour is undefined you say) either do a simple colour seperation or just turn it into black and white
(a cymk seperation is easy to write) Look at the resulting images of a few of your worst samples. Ideas often come from those.
Then do a simple edge detection and see if it approximates a top to bottom connection in the image and choose a probability
if you dont get a definite answer (your curved example might need an approximation if the background noise is bad and grey
and your line is whiteish grey for example)
You can get smarter but its seldom needed on this type of image. (Take a look at a cheap digital camera these days
and how easily they spot faces or smiles or even eye-blinks) - its all done by building up these methods.

It is a very simple image as these things go.
 

Dear 123jack,

Thank you very much for your kindly reply.

I tried the sobel edge detection by matlab but don't know how to get the region I am interested. The results by edge detection are some small non-connected segments.
As my know, the common features of all pictures provided to me are:
1) the ellipse;
2) the line at the right side in the ellipse region.

Except these two features, all other features are different, include the background inside or outside the ellipse region, the disturbs inside the ellipse region.

As you said, I am trying to mask out everything outside the ellipse region. However, I still can't find a general method that can seperate the ellipse region when the background changed. For example, there are another three pictures that I can't seperate them.

For the 'cymk seperation', I only know RGB to CYMK convert, could you please tell me some detailed information about CYMK seperation method, or some link?


Thanks,
Tang Laoya
IMG_2692_s5.jpg
P6240064_YCW.jpg
p3p5p9_p9.jpg

Hi Tang

Look for sobel edge detection as a starting point (its very much a staple).

As someone mentioned above - talk to whoever generates the image to ask them if they can standardise every aspect of it as much
as they can. This is always the first step as it reduces complexity of coding the most. They may not help but do ask.

I know the thread I pointed to is a bit long but the problem discussed is in effect the same as your own.
The solutions and methods are just the same but your problem is far easier than a random fracture.

What I'd do is:
Start by defining the range of different results and identifying what factors will always be present - those are what you look for.
Then think about how you could mask out everything you don't want
Then think about how software could find what you do want.

Off the top of my head looking at the couple of samples provided the first thing I'd do is mask out the right half of the image
then (because colour is undefined you say) either do a simple colour seperation or just turn it into black and white
(a cymk seperation is easy to write) Look at the resulting images of a few of your worst samples. Ideas often come from those.
Then do a simple edge detection and see if it approximates a top to bottom connection in the image and choose a probability
if you dont get a definite answer (your curved example might need an approximation if the background noise is bad and grey
and your line is whiteish grey for example)
You can get smarter but its seldom needed on this type of image. (Take a look at a cheap digital camera these days
and how easily they spot faces or smiles or even eye-blinks) - its all done by building up these methods.

It is a very simple image as these things go.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top