이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
How to draw lines on some part of defect segmented image.
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi, I want to draw two lines on image automatically. For your reference I have drawn those lines manually marked with green and violet colors using imline function as shown in matlab. Can anyone help me in this. Any help is much appreciated!!
댓글 수: 19
DGM
2021년 5월 8일
If you're using imline(), why not just ... use imline()? If you can calculate the extents of the line, just specify them:
% H = imline(HPARENT,X,Y) creates a draggable, resizable line on the
% object specified by HPARENT. X and Y specify the initial endpoint
% positions of the line in the form X = [X1 X2], Y =[Y1 Y2].
If you don't know the extents (X, Y), then how to find them depends entirely on your unstated goals.
Image Analyst
2021년 5월 8일
There are millions of pixels in the image. How are you "automatically" going to define the endpoints of a line segment? I see no rationale for why you picked the location of the endpoints that you chose. Can you describe in words what an algorithm would to to automatically find those points?
Do you want the lines IN the image (burned into the image pixels) or do you want do draw a line segment in the overlay above the image?
kanika bhalla
2021년 5월 10일
Hi DGM, Thank you so much for your reply.
H = imline(HPARENT,X,Y)- This is totally manually. I have to manually calculate the X = [X1 X2], Y =[Y1 Y2] coordinates. That is not practical for my objective. Actually I am working on a industrial AOI defect detection project. We need to automatically draw lines for the laser cutting. Could you share more ideas with me.
Thank you very much!!
kanika bhalla
2021년 5월 10일
Hi Image Analyst, Thank you very much for your reply.
"Automatically" defining of the endpoints of a line segment is challanging for me. I have picked the location of the endpoints that you chose because this defect is present on thev dataline which will lead to short circuit. Therefore the chosen points are the dataline points. I am working on the industrial project where we need to do laser cutting. Even I have no clue how I am going to do this automatically. If you can share any ideas. It would be helpful for me.
Thank you!!!
DGM
2021년 5월 19일
If you're trying to do something like that, then perhaps the defect itself does not contain information relevant to further processing; after all, it's a defect. We have no idea how you're identifying the defect or what the surrounding area looks like. You may need to use information derived either from the surroundings or from knowledge of the expected object structure.
kanika bhalla
2021년 5월 19일
Hi @DGM
Thank you very much for your answer.
Even I am not sure how to proceed further. Is there any way to seperate the colors and draw lines over it. As where i need to draw line is having different color from the other part. Can you share some functions to proceed further.
Thank you for your help!!
DGM
2021년 5월 19일
편집: DGM
2021년 5월 19일
I think at this point, we need a description of how you're identifying the defects, as well as some examples of the images being processed (if that's possible). I'm hardly an expert at this, so I tend to not have preformulated approaches to these things.
I imagine a starting point would be to determine the desired structures which intersect the defect and then determine how they should continue (or the inverse). That may not be very robust depending on how large the defects might be and whether the defects obscure features (like corners) which may confuse simple approaches.
kanika bhalla
2021년 5월 20일
Hi @DGM
Thank you very much for your help!!!
I have checked the link but my problem didn't get solve.
Thanks for introducing me with new concept of houghlines.
Image Analyst
2021년 5월 20일
Again, I have no idea where you drew any lines on that multicolored blob. I don't see violet and green lines. How about if I drew a line from (100,100) to (120, 150) -- would that work for you? If not, why not. I could draw a line between those coordinates completely automatically, with no interactive user involvement at all, as long as I knew then end points. If the endpoints of (100,100) and (120,150) don't work for you then explain in excrutiating detail why they don't work for you.
DGM
2021년 5월 20일
Let me illustrate the problem. Let's say we have some line features and a defect:
You can extract the defect alone:
But note that the defect doesn't contain any information about where the lines are supposed to be. The surroundings might:
So maybe that information could be used.
However, that information alone is potentially insufficient to solve the problem (or at least not without a lot of work). What if your routine finds something like this:
Would a simple routine that projects straight lines be able to figure that out correctly? What about this?
Of course, I still don't know what your images look like, so I'm just guessing at what difficulties might arise.
kanika bhalla
2021년 5월 20일
Thank you very much @DGM for further illustrating about the possible solutions to the problem. I want to discuss further on this. As the 2nd image posted by you is the same as what i obtained as shown above in this post. After that 3rd picture posted by you can be done in my case too. But how to obtain third picture and how it can be further used to mark lines.
I am attaching my original image from which I have obtained segmneted defect.
Could you please further guide me how I can proceed further to achieve my goal. Thank you so much for your time and help!!!
kanika bhalla
2021년 5월 20일
The lines were drawn manually on the blob using imline function. Violet and green lines are drawn on the blob as shown in the figure with pointed ends (imline function). As instructed by you to draw lines by giving coordinates. It will work and easily draw a line but this is manually done. As user is manually giving points. My task is to determine these points or coordinates automatically. I need to make 2 lines automatically as shown in the attached figure. Is there anyway to determine these coordinates automatically by some methods.
This is because defect is present on the green data lines and i need to do laser cutting from those lines. This will work as a path for laser cutting. Hope now description of the problem is clear. Thank you for your time and help!!
Image Analyst
2021년 5월 20일
So you want code to have the user manually draw a line and return the endpoints so you can draw a line? How about imline(), drawline(), or improfile(). Those all should do it.
If you don't want the user to manually draw anything, then say what they are taking into consideration when they are drawing lines. Otherwise how will I know where to draw them. Like the color gradient in the image or whatever. Like why was the purple line drawn there and not at a location shifted 20 pixels downward???
Post the original image that the user draws on, without the lines drawn/burned into it.
kanika bhalla
2021년 5월 20일
편집: kanika bhalla
2021년 5월 20일
No I don't want anything user to manually draw a line and return the endpoints so you can draw a line. I want to get the end points to draw line automatically. I have drawn those violet and green lines using imline function only. And drawline(), or improfile() won't solve my problem.
Yes I don't want the user to manually draw anything, that is why I want help or some ideas what can be taken into considereation from that defect part to draw lines. Like if there is any method or way I can get the coordinates of the image as my defect part is on white background. Is there any way that code will give coordinates where it will find value except 255.
The purple line drawn there and not at a location shifted 20 pixels downward because I am working on the industrial project of the automated inspection of the panel images. And the defect was present on the green data lines which will lead to short circuit. So, our task is basically to seperate the defect present on the green data lines. Therefore I need to draw lines only on green part so that i will generate a path for the laser cutting.
Here I have attached the original panel image, defect seperated from the panel image and I have already posted above the image where i have manually drawn the violet and red lines which should be done automatically rather than any user interaction.
Image Analyst
2021년 5월 21일
Probably not. It took you two weeks to finally describe the situation and that wasted a lot of time. Today I'm preparing for a week long trip and won't have much time. Plus finding defect blobs like that in an abritrary colored image would be very hard and take a lot of time, time that I can't afford to spend/donate for you. Maybe someone else will spend the time. Sorry.
kanika bhalla
2021년 5월 30일
편집: kanika bhalla
2021년 5월 31일
Helo Sir @Kalyan Acharjya Thank you so much for your reply. No Sir, I am still struggling a lot to solve the problem. Please help if you can. I will be forever grateful to you. Thank you!
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)