I have a very basic question about matlab. Can someone help me.
Im using one code form the help in matlab. As a result I have A vector or cluster not sure of it. But when I type the variable "line" in the command window, I get what is shown in the attached image
my question is: how do I read data from for example point one. Im finishing my semester project dude and I just need to be able to read that data
point1, point2, etc are embeded into the variable line.
do you want me to send you the code?
clc % Leer la imagen I = imread('test2.jpg'); % Pasar a escala gris I = rgb2gray(I); % Binarizar la imagen BW = edge(I,'canny'); % Calculo de la transformada de hough [H,T,R] = hough(BW); P = houghpeaks(H,2); x = T(P(:,2)); y = R(P(:,1)); % Find lines and plot them lines = houghlines(BW,T,R,P,'FillGap',5,'MinLength',7); figure, imshow(I), hold on max_len = 0; for k = 1:length(lines) xy = [lines(k).point1; lines(k).point2]; plot(xy(:,1),xy(:,2),'LineWidth',2,'Color','green'); % Plot beginnings and ends of lines plot(xy(1,1),xy(1,2),'x','LineWidth',2,'Color','yellow'); plot(xy(2,1),xy(2,2),'x','LineWidth',2,'Color','red'); % Determine the endpoints of the longest line segment len = norm(lines(k).point1 - lines(k).point2); if ( len > max_len) max_len = len; xy_long = xy; end end
you should place that image in the folder you run the code
you put in you code "lines(k).point1" and that how you can get point1 value is not it ?
I think I already found the answer
did you run the code?
now I dont have matlab in my PC
I type this "lines(:,1)" and I got into the firs subarray. Im lucky
by "lines(:,1) you get all elements in the subarray number 1
then what should I do. Coz data is still embeded into three subarrayis
point1: [180 436] point2: [362 436] theta: -90 rho: -434.7394
just need point one and 2
lines(1,1) to get the value 180 and so on
No Im stuck. Its not working
when you write lines(:,1) , what did you get ?
point1: [180 436] point2: [362 436] theta: -90 rho: -434.7394
I stored that into variable A
you got all the results just when you type :lines(:,1) ?
then I tried A(:,1) in order to get point1. I though that could work
yeah. I think lines is comprised of sub-arrays (point1, point2, theta, rho)
try lines(1).point1 or lines.point1
YEAH!
it did work haha
thank you so much
:)
good for you you are welcome any time :)
shadyak can u help me
ok write a new question
i wrote already which is the best and fastest downloading manager except internet download manager
Join our real-time social learning platform and learn together with your friends!