Three-point confirmation center in MATLAB

Source: Internet
Author: User

Clear all; close all; clc;
IMG = imread ('e: \ 4.jpg ');
Subplot (121); imshow (IMG );
[X y] = size (IMG); % calculate the pixel size! X = 243, y = 1026
IMG = double (IMG); % convert IMG to double type

% Sobel Edge Detection
W = fspecial ('job'); % specifies the filter type 'job'
Img_w = imfilter (IMG, W, 'replicate'); % calculates the horizontal edge
W = W ';
Img_h = imfilter (IMG, W, 'replicate'); % calculates the vertical edge
IMG = SQRT (img_w. ^ 2 + img_h. ^ 2); % pay attention to the sum of squares in the square
Subplot (122); imshow (uint8 (IMG ))

Impixelinfo;
A = ginput (3 );
P = (A (1) + a (2) + a (3)/3;
Q = (A (4) + a (5) + a (6)/3;
Hold on;
Plot (p, q ,'*');
[P, q] % particle Coordinate

 

Three-point confirmation center in MATLAB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.