current position：Home>The image is processed and analyzed to calculate the fringe spacing in the image
The image is processed and analyzed to calculate the fringe spacing in the image
2022-02-03 02:33:05 【CSDN Q & A】
The phenomenon and background of the problem
Problem related code , Do not paste screenshots
Operation results and error reporting contents
My solution ideas and tried methods
What I want to achieve
Refer to the answer 1：
Hello, classmate , The main process is to find out the position and inclination of the strip
clc; clearimg = imread('pic.png'); % Read in the picture pic.png For example, the file name is this figure(1);imshow(img),title(' Original picture ');% Convert to grayscale image img=rgb2gray(img);% Convert to binary image BW=imbinarize(img); % High pass filter denoising sigma=1;% Standard deviation of filter parameters=double(3*sigma*2+1); % Formwork size H=fspecial('gaussian', parameters, sigma);% Filter operator %gaussian low pass filter BW=imfilter(BW,H,'replicate');% Ossification BW1=bwmorph(BW,'skel',20);% Deburring ( Eliminate noise )BW2=bwmorph(BW1,'spur',18);figure(2); clfimshow(BW2)[m,n,~] = size(BW2);nbd = floor(n/5);BW3 = BW2(nbd:end-nbd, nbd:end);imshow(BW3);[x,y] = find(BW3);p = polyfit(x,y,1); % This step is mainly to solve the inclination p(1) = tan(theta)[X,Y] = meshgrid(1:n, 1:m);[x0, y0] = meshgrid(1:n, floor(m/2));z0 = interp2(X,Y,double(img)/255,x0,y0);figure(3); clfz0 = smooth(z0);plot(x0,z0)[pks, locs ]= findpeaks(z0); % Find the highest white value BandLength = mean(diff(locs))*cos(atan(p(1))) % Strip width , Count according to the number of pixels
The final width is
Here is the width of such a pixel
Refer to the answer 2：
author[CSDN Q & A],Please bring the original link to reprint, thank you.
The sidebar is recommended
- Read out the contents of the file "student. TXT" by line and write them to the file "hello. TXT", and add the line number to each line. It is required to output the contents of the file "hello. TXT".
- MySQL creates a database with an error
- The input of binary string in Python
- Django doesn't respond to startup
- Can pandas directly modify CSV or excel original files and save them
- In the Oracle subquery, the from is not a table but a condition. Why
- Pytorch loss = criterion (outputs, y), y has multiple values
- The most basic thing in confusion is not to understand chatting
- What's wrong with the scanner usage?
- How to display the obtained value by month, year and day?
guess what you like
Skimage module plus Gaussian noise
CDN fake domain name URL JS script
Recursive method output Huffman tree leaf node Huffman coding algorithm program
Merging word document content with VB
What should I do if pycharm runs with this error
Char function and string program running
C + + may be caused by deep and shallow copy
Defining variables in use + splicing
Why can't I install Android WiFi ADB when I use Android studio?
How does the repeater refresh the data source?
- Import the list file (. Txt) of the lottery program, export the result list file, and remove the selected code. Can you tell us what the code of these three modules means
- How to solve the problem of list index out of range
- How did you get the pop-up window of wechat applet?
- After assignment, the program stops running here
- Student information management system score summation
- What if the Java access system protection file reports an error NullPointerException
- Python printing hollow diamond
- How does Python's sympy module use the specific value input to solve the system of binary primary equations
- An error occurred while trying to install the pilot, as shown in the figure below
- Question: operator priority
- module random has no attribute choices
- I'm using the form of antd mobile When the item form is, the border bottom is cleared
- Decimal to binary, really do not know how to achieve multiple number conversion and output, C language
- Pycharm HTML edit master page call
- I hope to output the maximum, minimum and sub maximum values through sorting, but I don't know why I can't output them
- How to use C99 mode in VIM editor
- Why is RBF network often used in condition diagnosis? Why convolutional neural networks are often used in images In speech recognition?
- What if there are too many repetitions in the visual studio theme
- Why is C + + broken~
- What does the class name + [number] mean? Can all classes be used in this way?
- The pandas method concat failed to sort while merging multiple CSV files
- Python username and password authentication
- What is a hash table and a simple explanation?
- How to output pictures 1:1 in GC power 2000
- Failed to restart the service after repairing log4j vulnerability
- Java MySQL single table ten million level data summation
- Hash tables store strings using open addressing
- On the number of iterations generated in the process of ICP point cloud registration
- [urgent!] Requests in Django Post exception
- Java string accepts that the field value becomes. 2, and 0 is missing
- Ladies and gentlemen, what documents are needed in the process of data center construction? Please give a detailed document name
- MySQL connector 5.1.25 and JDBC, the deletion syntax is correct, but there is no prompt that the deletion is successful, and the program does not report an error.
- The Weblogic cluster console restarts the server and automatically deletes the TMP cache
- Application of java object-oriented array
- Why does C have pointers and python doesn't
- Want to know how to complete the following C + + program?
- Count in the string and find the English characters
- C language hexadecimal conversion to decimal and octal
- C language channel management (at least 20 channels)
- Suspected ARP attack, but different