My image is a square. What i want here is: select 4 points on the upper horizontal boundary in the square and along those 4 points draw a straight line. (eventually, repeat this for all 4 sides). What functions should i use?
When selecting points i can use ginput(4) i guess, but i doubt houghline is the function for drawing straight line along selected points? Any suggestions?

 채택된 답변

Image Analyst
Image Analyst 2015년 2월 28일

0 개 추천

To plot the line in the overlay, you can use line()
line([x1 x2], [y1 y2], 'Color', 'r');
To "burn" the line into the image, you can either use normal indexing if the line is along rows and columns
grayImage(row1:row2, col) = 255; % or whatever intensity you want
or you can use imline() if the points are not in the same row or column, as the attached demo illustrates.

댓글 수: 3

Chathu
Chathu 2015년 2월 28일
@ Image Analyst- line() works well. Thank you so much for your rapid response. Really appreciate it.
If i want to register images,is there any in-built function in MatLab just like cpselect for line() function ?
Image Analyst
Image Analyst 2015년 2월 28일
I don't know what that last sentence means. Yes, there is an imregister() function, and related functions like imwarp(). Is that what you're looking for?
Chathu
Chathu 2015년 2월 28일
@ Image Analyst- sorry to confuse you. But thank you so much for your response. Really appreciate your effort.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2015년 2월 28일

댓글:

2015년 2월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by