Problem with overlapping line on image

조회 수: 1 (최근 30일)
Mary
Mary 2015년 10월 23일
답변: Sudhanshu Bhatt 2015년 10월 28일
I have an image.I have a line .I want to overlap this line on the image. I tried using the below lines.But I am seeing both separate. imshow(x);hold on; houghline(x,r,theta);
Any suggestions please?
Thanks, Mary
  댓글 수: 1
Image Analyst
Image Analyst 2015년 10월 23일
I suggest you attach your image with the green and brown frame icon so we can see what you're seeing. Maybe a screenshot even.

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

답변 (1개)

Sudhanshu Bhatt
Sudhanshu Bhatt 2015년 10월 28일
Hi Mary,
It will be helpful if you can explain what workflow are you trying to achieve? Do you need to just plot a line on the image? Or the requirement is to highlight a line segment extracted by HOUGHLINES function?
Case 1: To draw a line on an image can be done from the code below:
% Read an image, create figure and show an image on the current Figure
% The image is provided with MATLAB, it can be found by executing
% >> which -all autumn.tif
img = imread('autumn.tif');
figure, imshow(img);
% Use hold on so we can retain current plot while plotting line
hold on;
% Plot the new line
plot([0,200],[10,200],'Color','r','LineWidth',2)
%Removing hold on the current plot
hold off;
Case 2: If you want to extract line segments based on Hough transform using HOUGHLINES and highlight them by drawing a line on the plotted image, please follow the example mentioned in the link below:
If this does not resolve your issue, please create a Technical Support Request by visiting the link below:
Thanks
Sudhanshu Bhatt

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by