Halcon 極坐標轉換圖像

一、概述

先看效果

將圓形的用極坐標轉換成矩性然后再進行識別或者其他缺陷檢測,最后在還圓到原圖中

二、原理:

halcon 圓環類缺陷檢測的一種方法(極坐標變換法)_halcon缺口檢測-CSDN博客

圖像極坐標變換與反變換(Halcon + OpenCV)_將 環形虹膜圖像的極坐標轉換成矩形圖像-CSDN博客

?極坐標轉換: 圓形圖像--》矩形圖像? ?

原理:

三、實踐

案例一

dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Beer, '/tem.png')
get_image_size (Beer, Width, Height)
draw_circle (WindowHandle, Row1, Column1, Radius)
gen_circle (Circle, Row1, Column1, Radius)
reduce_domain (Beer, Circle, ImageReduced)
PI:=3.1415926
*WidthPolar := (OuterRadius - 5)*2*3.14
W:=(Radius-150)*2*3.14
H:=300
*逆時針,從0度到360度,轉一圈
*                        原始圖像     極坐標之后的圖像   圖像中心坐標row col  起始角度 終止角度  開始半徑 結束半徑                   差值方式
polar_trans_image_ext (ImageReduced, PolarTransImage,  Row1,  Column1,      0,      2*PI,     0,     Radius*2,   W, H, 'bilinear')dev_display (ImageZoomed)
*長和寬必須是原圖像的長和寬,否則尺寸太小的話,圖像容易超出,導致一片黑,看不到轉換結果
*極坐標圖像轉笛卡爾坐標系圖像  恢復之前的圖像
polar_trans_image_inv (PolarTransImage, RestoreImage, Row1, Column1, 0, 2*PI, 0, Radius, Width, Height, 'bilinear')
write_image (RestoreImage, 'jpeg 100', 0, 'd:\\2.jpg')*點坐標的轉換
*Contour的原坐標是基于極坐標系,我們把它轉到笛卡爾坐標系
gen_contour_polygon_xld (Contour, [155.568, 137.404, 30], [47.4712, 116.479, 260])
polar_trans_contour_xld_inv (Contour, XYTransContour, Row1, Column1, 0, 2*PI, 0, Radius, Width, Height, Width, Height)

?

?案例二、

dev_update_off ()
get_system ('clip_region', Information)
set_system ('clip_region', 'true')
read_image (Image, 'barcode.png')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width / 2, Height / 2, 'black', WindowHandle)
dev_set_colored (12)
dev_display (Image)
stop ()
* 分割包含條形碼的CD上的環。
threshold (Image, Region, 0, 100)
closing_circle (Region, Region, 3.5)
connection (Region, ConnectedRegions)
*篩選出圓環
select_shape (ConnectedRegions, Ring, ['width','height'], 'and', [550,550], [750,750])
shape_trans (Ring, OuterCircle, 'outer_circle')
complement (Ring, RegionComplement)
connection (RegionComplement, ConnectedRegions)
select_shape (ConnectedRegions, InnerCircle, ['width','height'], 'and', [450,450], [650,650])
*提取并生成圓環區域外圓,內圓
* 確定包含條形碼的環的參數。
smallest_circle (Ring, Row, Column, OuterRadius)
smallest_circle (InnerCircle, InnerRow, InnerColumn, InnerRadius)
dev_set_color ('green')
dev_set_draw ('margin')
dev_set_line_width (3)
dev_display (Image)
dev_display (OuterCircle)
dev_display (InnerCircle)
stop ()
* 現在讀條形碼。這是通過計算包含條形碼的圖像中圓環的極坐標變換來實現的。
* WidthPolar := 1440
*內圓的周長
WidthPolar := (OuterRadius - 5)*2*3.14
HeightPolar := round(OuterRadius - InnerRadius - 10)
*極坐標變換(中心Row, Column,用圓環的圓心坐標。起始角度是0到360度。起始半徑分別是圓環內圓的半徑和外圓的半徑。
*寬高分別是圓環外圓的周長和外圓半徑減去內圓半徑的值)
polar_trans_image_ext (Image, PolarTransImage, Row, Column,0, rad(360), InnerRadius + 5, OuterRadius - 5, WidthPolar, HeightPolar, 'bilinear')
*逆向轉換回圓環圖像,以查看此函數效果
polar_trans_image_inv (PolarTransImage, XYTransImage, Row, Column, 0, rad(360), InnerRadius + 5, OuterRadius - 5,  Width, Height, 'nearest_neighbor')
invert_image (PolarTransImage, ImageInvert)
* 由于條形碼區域相當平坦,因此圖像的高度增加了一倍。
zoom_image_factor (ImageInvert, ImageZoomed, 1, 2, 'weighted')
get_image_size (ImageZoomed, Width1, Height1)
dev_resize_window_fit_size (0, 0, Width1, Height1, -1, -1)
dev_display (ImageZoomed)
stop()
create_bar_code_model ([], [], BarCodeHandle)
* 條形比較小,對比度也低;因此,閾值從0.05提高到0.1。
set_bar_code_param (BarCodeHandle, 'element_size_min', 1.5)
set_bar_code_param (BarCodeHandle, 'meas_thresh', 0.3)
find_bar_code (ImageZoomed, SymbolRegions, BarCodeHandle, 'Code 128', DecodedDataStrings)
clear_bar_code_model (BarCodeHandle)
dev_set_window_extents (-1, -1, WidthPolar / 2, HeightPolar)
dev_display (ImageZoomed)
dev_display (SymbolRegions)
set_system ('clip_region', Information)
disp_message (WindowHandle, DecodedDataStrings, 'image', 10, 180, 'black', 'true')
stop ()* 主要是要顯示到原來的那個區域
* 將條碼區域轉換回原始圖像并顯示。
zoom_region (SymbolRegions, SymbolRegions, 1, 0.5)
polar_trans_region_inv (SymbolRegions, CodeRegionCircular, Row, Column, 0, rad(360), InnerRadius + 5, OuterRadius - 5, WidthPolar, HeightPolar, Width, Height, 'nearest_neighbor')
dev_set_window_extents (-1, -1, Width / 2, Height / 2)
dev_display (Image)
dev_display (CodeRegionCircular)
disp_message (WindowHandle, DecodedDataStrings, 'window', 12, 12, 'black', 'true')

?案例三

* 
* tuning parameters
SmoothX := 501
ThresholdOffset := 25
MinDefectSize := 50
* 
* initialization
PolarResolution := 640
RingSize := 70
get_system ('store_empty_region', StoreEmptyRegion)
set_system ('store_empty_region', 'false')
read_image (Image, 'bottles/bottle_mouth_01')
dev_update_off ()
dev_close_window ()
dev_close_window ()
dev_open_window_fit_image (Image, 0, 0, 640, 512, WindowHandle1)
set_display_font (WindowHandle1, 16, 'mono', 'true', 'false')
dev_display (Image)
dev_set_draw ('margin')
dev_set_line_width (3)
dev_open_window_fit_size (0, 648, RingSize, PolarResolution, 150, 512, WindowHandle)
dev_set_draw ('margin')
dev_set_line_width (3)
dev_set_color ('red')
* 
* Main loop
* 
* Detect defects in bottle necks
for Index := 1 to 16 by 1read_image (Image, 'bottles/bottle_mouth_' + Index$'.02')* * Part 1: 使用blob 分析將外部圓找出來auto_threshold (Image, Regions, 2)select_obj (Regions, DarkRegion, 1)opening_circle (DarkRegion, RegionOpening, 3.5)closing_circle (RegionOpening, RegionClosing, 25.5)fill_up (RegionClosing, RegionFillUp)boundary (RegionFillUp, RegionBorder, 'outer')dilation_circle (RegionBorder, RegionDilation, 3.5)reduce_domain (Image, RegionDilation, ImageReduced)* * 使用邊緣亞像素來找輪廓  并擬合圓edges_sub_pix (ImageReduced, Edges, 'canny', 0.5, 20, 40)segment_contours_xld (Edges, ContoursSplit, 'lines_circles', 5, 4, 2)union_cocircular_contours_xld (ContoursSplit, UnionContours, 0.9, 0.5, 0.5, 200, 50, 50, 'true', 1)length_xld (UnionContours, Length)select_obj (UnionContours, LongestContour, sort_index(Length)[|Length| - 1] + 1)fit_circle_contour_xld (LongestContour, 'ahuber', -1, 0, 0, 3, 2, Row, Column, Radius, StartPhi, EndPhi, PointOrder)* * Part 2: 極坐標轉換gen_circle (Circle, Row, Column, Radius)dilation_circle (Circle, RegionDilation, 5)erosion_circle (Circle, RegionErosion, RingSize - 5)difference (RegionDilation, RegionErosion, RegionDifference)reduce_domain (Image, RegionDifference, ImageReduced)polar_trans_image_ext (ImageReduced, ImagePolar, Row, Column, 0, rad(360), Radius - RingSize, Radius, PolarResolution, RingSize, 'nearest_neighbor')* * Part 3:檢測是否有缺陷scale_image_max (ImagePolar, ImageScaleMax)mean_image (ImageScaleMax, ImageMean, SmoothX, 3)*原圖區域-均值后的區域  =有差異的區域dyn_threshold (ImageScaleMax, ImageMean, Regions1, 55, 'not_equal')connection (Regions1, Connection)select_shape (Connection, SelectedRegions, 'height', 'and', 9, 99999)* ignore noise regionsclosing_rectangle1 (SelectedRegions, RegionClosing1, 10, 20)union1 (RegionClosing1, RegionUnion)* re-transform defect regions for visualizationpolar_trans_region_inv (RegionUnion, XYTransRegion, Row, Column, 0, rad(360), Radius - RingSize, Radius, PolarResolution, RingSize, 1280, 1024, 'nearest_neighbor')* * Part 4: Display results* display original image with resultsdev_set_window (WindowHandle1)dev_display (Image)dev_set_color ('blue')dev_display (RegionDifference)dev_set_color ('red')dev_display (XYTransRegion)* display polar transformed inspected region with results* The image and resulting region are rotated by 90 degrees* only for visualization purposes! (I.e. to fit better on the screen)* The rotation is NOT necessary for the detection algorithm.dev_set_window (WindowHandle)*旋轉圖像rotate_image (ImagePolar, ImageRotate, 90, 'constant')dev_display (ImageRotate)count_obj (RegionUnion, Number)if (Number > 0)mirror_region (RegionUnion, RegionMirror, 'diagonal', PolarResolution)mirror_region (RegionMirror, RegionMirror, 'row', PolarResolution)dev_display (RegionMirror)disp_message (WindowHandle1, 'Not OK', 'window', 12, 12, 'red', 'false')elsedisp_message (WindowHandle1, 'OK', 'window', 12, 12, 'forest green', 'false')endifif (Index < 16)disp_continue_message (WindowHandle1, 'black', 'true')stop ()endif
endfor
* Reset system parameters
set_system ('store_empty_region', StoreEmptyRegion)

案例四

https://blog.csdn.net/cashmood/article/details/104709546

ead_image (Image, '1.png') 
rgb3_to_gray (Image, Image, Image, ImageGray) 
dev_open_window_fit_image (ImageGray, 0, 0, -1, -1, WindowHandle) 
dev_set_draw ('margin') 
dev_set_line_width (3) 
dev_set_draw ('margin') 
* dev_set_draw ('fill') 
get_image_size (ImageGray, Width, Height) 
binary_threshold (ImageGray, Region, 'max_separability', 'dark', UsedThreshold) 
connection (Region, ConnectedRegions) 
select_shape_std (ConnectedRegions, SelectedRegions, 'max_area', 70) * 計算最外測圓的直徑
smallest_circle (SelectedRegions, Row2, Column2, Radius) 
gen_circle (Circle, Row2, Column2, Radius) 
reduce_domain (ImageGray, Circle, ImageReduced2) 
gray_closing_rect (ImageReduced2, ImageClosing1, 10, 4) 
*極坐標轉換  
polar_trans_image_ext (ImageClosing1, PolarTransImage1, Row2, Column2, 0, 6.28319, Radius-100, Radius-10, 6.28*Radius, 90, 'nearest_neighbor') mean_image (PolarTransImage1, ImageMean1, 500, 2) 
dyn_threshold (PolarTransImage1, ImageMean1, RegionDynThresh1, 7, 'dark') 
connection (RegionDynThresh1, ConnectedRegions1) 
select_shape (ConnectedRegions1, SelectedRegions1, 'area', 'and',100, 9000000) 
union1 (SelectedRegions1, RegionUnion) 
closing_rectangle1 (RegionUnion, RegionClosing1, 10, 20) 
connection (RegionClosing1, ConnectedRegions3) opening_rectangle1 (ConnectedRegions3, RegionOpening1, 10, 20) * 將區域還原到原圖上
polar_trans_region_inv (RegionOpening1, XYTransRegion1, Row2, Column2, 0, 6.28319, Radius-100, Radius-10, 6.28*Radius, 90, Width, Height, 'nearest_neighbor') 
smallest_circle (XYTransRegion1, Row, Column, Radius1) 
gen_circle (Circle1, Row, Column, Radius1) 
dev_display (ImageGray) 
dev_display (Circle1)

五、Opencv :

#include <iostream>
#include <opencv2/opencv.hpp>using namespace std;
using namespace cv;int main() {Mat img = imread("rainbow.png");if (!img.data) {cout << "請檢查圖像文件名稱是否正確" << endl;return -1;}Mat   img1, img2;Point center = Point(img.cols / 2, img.rows / 2); //極坐標在圖像中的原點//正極坐標變換->方變圓warpPolar(img, img1, Size(512, 512), center, center.x, WARP_POLAR_LINEAR);//逆極坐標變換->圓變方warpPolar(img1,img2,Size(img.rows,img.cols),center,center.x,WARP_INVERSE_MAP);imshow("Original", img);imshow("Anti Polar Result", img2);imshow("Polar Result", img1);waitKey(0);return 0;
}

圖像極坐標變換與反變換(Halcon + OpenCV)_將 環形虹膜圖像的極坐標轉換成矩形圖像-CSDN博客?

//
// Created by zzl on 2020/12/20.
//#include <iostream>
#include "opencv2/opencv.hpp"using namespace std;
using namespace cv;// 矩形圖像轉圓形
Mat Rectangle_to_Circle(const Mat &src, int Width);Mat Circle_to_Rectangle(const Mat &src);uchar getPixel(const Mat &src, double X, int X_up, int X_down, double Y, int Y_up, int Y_down);int main(int argc, char **argv) {// 讀入圖像Mat src, dst;src = imread("/home/zzl/Blog/CoordinateTrans/Data/testimage4.jpg", 0);namedWindow("InputImages", WINDOW_NORMAL);imshow("InputImages", src);dst = Rectangle_to_Circle(src, 2 * src.rows);namedWindow("OutputImages", WINDOW_NORMAL);imshow("OutputImages", dst);Mat dst2;dst2 = Circle_to_Rectangle(dst);namedWindow("OutputImages2", WINDOW_FREERATIO);imshow("OutputImages2", dst2);cout << "Hello World" << endl;waitKey();return 0;
}Mat Rectangle_to_Circle(const Mat &src, int Width) {int src_height = src.rows;int src_width = src.cols;Size dstSize = Size(2 * src_height, 2 * src_height);Mat dst = Mat::zeros(dstSize, CV_8UC1);// 極坐標變換double scale_r = 2 * src_height / (dstSize.width);double scale_theta = src_width / CV_2PI;Mat tmp = Mat::zeros(dst.size(), CV_64FC1);for (int i = 0; i < dstSize.height; ++i) {for (int j = 0; j < dstSize.width; ++j) {// 計算距離Point2d center(dstSize.width / 2, dstSize.width / 2);double distance = sqrt(pow(i - center.y, 2) + pow(j - center.x, 2));
//            tmp.at<double>(j, i) = distance;if (distance < dstSize.width / 2) {// 處于邊界內部的點,可以提取像素// 坐標變換求對應方圖上的點的坐標double Rec_Y = distance * scale_r; //Y 方向坐標if (Rec_Y < 0) {Rec_Y = 0;}if (Rec_Y > dstSize.width / 2) {Rec_Y = dstSize.width / 2;}double line_theta = atan2(i - center.y, j - center.x);if (line_theta < 0) {line_theta += CV_2PI;}if (line_theta < 0) {cout << "仍然小于0" << endl;}double Rec_X = line_theta * scale_theta;dst.at<uchar>(i, j) = src.at<uchar>((int) Rec_Y, (int) Rec_X);}}}// ---- 顯示圖像邊界距離
//    normalize(tmp, tmp, 0, 1, NORM_MINMAX);
//    Mat display;
//    tmp.convertTo(display, CV_8UC1, 255.0);
//
//    namedWindow("Distance", WINDOW_NORMAL);
//    imshow("Distance", display);
//    waitKey();
//    circle(display, Point2d(Width / 2, Width / 2), Width / 2, 0, 10, LINE_8);
//    imshow("Distance", display);
//    waitKey();return dst;
}Mat Circle_to_Rectangle(const Mat &src) {// 變換不同的圖像大小有不同的效果Mat dst = Mat::zeros(Size((int) (src.cols * CV_PI) + 1, src.cols / 2 + 1), CV_8UC1);
//    Mat dst = Mat::zeros(Size(src.cols / 2 + 1, src.cols / 2 + 1), CV_8UC1);double scale_r = src.cols / (dst.rows);double scale_theta = 2 * CV_PI / dst.cols;for (int i = 0; i < dst.cols; ++i) {double theta = i * scale_theta;double sinTheta = sin(theta);double cosTheta = cos(theta);for (int j = 0; j < dst.rows; ++j) {double p = j * scale_r;double X = (src.rows / 2 + cosTheta * p);double Y = (src.cols / 2 + sinTheta * p);int X_up = ceil(X);int X_down = floor(X);int Y_up = ceil(Y);int Y_down = floor(Y);if (X > src.cols) {X = src.cols;}if (X < 0) {X = 0;}if (Y > src.rows) {Y = src.rows;}if (Y < 0) {Y = 0;}// 若使用插值算法需要取消注釋
//            uchar tmp_Pixel = getPixel(src, X, X_up, X_down, Y, Y_up, Y_down);
//            dst.at<uchar>(j, i) = tmp_Pixel;dst.at<uchar>(j, i) = src.at<uchar>(Y, X); // 最近鄰算法}}return dst;
}uchar getPixel(const Mat &src, double X, int X_up, int X_down, double Y, int Y_up, int Y_down) {// 插值算法// X 為水平方向坐標 X_up、X_down分別為向上向下取整后的值 Y同理double inter_val = 0;if (X_up == X_down && Y_up == Y_down) {inter_val = saturate_cast<uchar>(src.at<uchar>(Y_up, X_up));} else if (X_up == X_down) {inter_val = saturate_cast<uchar>((Y_up - Y) * src.at<uchar>(Y_up, X_up) +(Y - Y_down) * src.at<uchar>(Y_down, X_up));} else if (Y_up == Y_down) {inter_val = saturate_cast<uchar>((X_up - X) * src.at<uchar>(Y_up, X_up) +(X - X_down) * src.at<uchar>(Y_up, X_down));} else {double Y_tmp = saturate_cast<uchar>((X_up - X) * src.at<uchar>(Y_down, X_up) +(X - X_down) * src.at<uchar>(Y_down, X_down));double X_tmp = saturate_cast<uchar>((X_up - X) * src.at<uchar>(Y_up, X_up) +(X - X_down) * src.at<uchar>(Y_up, X_down));inter_val = (Y_up - Y) * X_tmp + (Y - Y_down) * Y_tmp;}return (uchar) inter_val;
}

?

?

?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/15019.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/15019.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/15019.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

吳恩達深度學習筆記:超 參 數 調 試 、 Batch 正 則 化 和 程 序 框 架(Hyperparameter tuning)3.4-3.5

目錄 第二門課: 改善深層神經網絡&#xff1a;超參數調試、正 則 化 以 及 優 化 (Improving Deep Neural Networks:Hyperparameter tuning, Regularization and Optimization)第三周&#xff1a; 超 參 數 調 試 、 Batch 正 則 化 和 程 序 框 架&#xff08;Hyperparameter …

Spark SQL【Java API】

前言 之前對 Spark SQL 的影響一直停留在 DSL 語法上面&#xff0c;感覺可以用 SQL 表達的&#xff0c;沒有必要用 Java/Scala 去寫&#xff0c;但是面試一段時間后&#xff0c;發現不少公司還是在用 SparkSQL 的&#xff0c;京東也在使用 Spark On Hive 而不是我以為的 Hive O…

ubuntu20.04 開機自動掛載外加硬盤

文章目錄 一、問題描述二、操作1. 查找新添盤符2. 格式化硬盤文件系統3. 掛載硬盤4. 開機自動掛載5. 取消掛載6. 查看掛載的硬盤信息 一、問題描述 因電腦使用一段時間后自身硬盤不足&#xff0c;需外加硬盤使得電腦自動識別加載。 二、操作 1. 查找新添盤符 sudo blkid自己…

Linux基礎命令詳解

Linux基礎命令詳解 1. ls 解釋&#xff1a;列出目錄內容用法&#xff1a;ls [選項] [文件名]示例&#xff1a;ls -l&#xff08;以長格式顯示文件信息&#xff09; 2. cd 解釋&#xff1a;更改目錄用法&#xff1a;cd [目錄名]示例&#xff1a;cd /home&#xff08;切換到/…

# 全面解剖 消息中間件 RocketMQ-(3)

全面解剖 消息中間件 RocketMQ-&#xff08;3&#xff09; 一、RocketMQ – mqadmin 命令介紹 1、mqadmin 管理工具 使用方式 進入 RocketMQ 安裝位置&#xff0c;在 bin 目錄下執行 ./mqadmin {command} {args} # 進入 RocketMQ 安裝目錄的 bin 目錄下&#xff1a; cd /usr…

免費、開源、好用的 SQL 客戶端合集

免費、開源、好用的 SQL 客戶端合集 分類 編程技術 0、SQL Chat SQL Chat 是 2023 年 3 月推出的新型 SQL 客戶端&#xff0c;它將數據庫管理帶入了基于聊天的新時代。 SQL Chat 由 ChatGPT 驅動&#xff0c;能夠幫你編寫和潤色 SQL 語句&#xff0c;讓數據庫操作變得更加智…

微信小程序開發環境的搭建

一、注冊微信小程序賬號 二、安裝微信開發者工具 1.下載微信開發者工具。 官網下載地址&#xff1a;https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/downloads.html 2、選擇穩定版Window64下載安裝 3、下載完畢后&#xff0c;點擊下一步安裝 三、使用微信開發者工具…

SQLite查詢優化

文章目錄 1. 引言2. WHERE子句分析2.1. 索引項使用示例 3. BETWEEN優化4. OR優化4.1. 將OR連接的約束轉換為IN運算符4.2. 分別評估OR約束并取結果的并集 5. LIKE優化6. 跳躍掃描優化7. 連接7.1. 手動控制連接順序7.1.1. 使用 SQLITE_STAT 表手動控制查詢計劃 1. 引言 給定一個…

C# 特性(Attribute)超詳細教程

文章目錄 0.前篇1.特性概念2.特性的聲明和使用2.1 特性定義語法2.2 特性目標 3.預定義特性3.1 AttributeUsage3.2 Conditional3.3 其它預定義特性 4.MyAttributeHelper&#xff08;特性使用幫助類&#xff09;5.特性應用5.1 添加說明信息并獲取5.2 數據驗證 0.前篇 學習本文前…

聊聊Python中的文件讀寫操作

Python 中的文件讀寫操作是數據處理和存儲的基本操作之一。下面&#xff0c;我將詳細解釋如何在 Python 中進行文件的讀寫操作。 1. 打開文件 在 Python 中&#xff0c;使用 open() 函數來打開文件。這個函數需要至少一個參數&#xff0c;即文件名&#xff0c;并且返回一個文件…

數據結構和組成

數據結構組成 數據項&#xff1a;一個數據元素可以由若干數據項組成。 數據對象&#xff1a;有相同性質的數據元素的集合&#xff0c;是數據的子集。 數據結構&#xff1a;是相互之間存在一種或多種特定關系的數據元素的集合。 邏輯結構 數據對象中數據元素之間的相互關系 eg: …

深入理解python列表遍歷:兩種方法詳解與實例

新書上架~&#x1f447;全國包郵奧~ python實用小工具開發教程http://pythontoolsteach.com/3 歡迎關注我&#x1f446;&#xff0c;收藏下次不迷路┗|&#xff40;O′|┛ 嗷~~ 目錄 一、引言 二、使用索引遍歷列表 三、直接使用元素遍歷列表 四、總結 一、引言 在編程過程…

創建python字典的兩種方法:直觀與函數式

新書上架~&#x1f447;全國包郵奧~ python實用小工具開發教程http://pythontoolsteach.com/3 歡迎關注我&#x1f446;&#xff0c;收藏下次不迷路┗|&#xff40;O′|┛ 嗷~~ 目錄 一、直觀創建法&#xff1a;直接定義鍵值對 二、函數式創建法&#xff1a;使用內置函數dict…

CSRF 攻擊

概述 CSRF(Cross-site request forgery,跨站請求偽造)。 它是指攻擊者利用了用戶的身份信息&#xff0c;執行了用戶非本意的操作。 它首先引導用戶訪問一個危險網站&#xff0c;當用戶訪問網站后&#xff0c;網站會發送請求到被攻擊的站點&#xff0c;這次請求會攜帶用戶的c…

拼多多攜手中國農業大學,投建陜西佛坪山茱萸科技小院

5月16日下午&#xff0c;中國農業大學陜西佛坪山茱萸科技小院在佛坪縣銀廠溝村揭牌。佛坪縣素有“中國山茱萸之鄉”的美譽&#xff0c;是全國山茱萸三大基地之一&#xff0c;當地山茱萸是國家地理標志產品&#xff0c;山茱萸肉產量位居全國第二。 為充分發揮佛坪縣得天獨厚的山…

vscode快捷鍵mac快捷鍵

vscode快捷鍵 在 Visual Studio Code 中&#xff0c;可以使用「Ctrl D」快捷鍵來選中相同內容。還可以使用以下快捷鍵來操作&#xff1a; 向上/下選擇相同內容 Alt ↑/↓ 選擇所有相同內容 Ctrl Shift L mac中則是commandshiftL VSCode刪除整行快捷鍵 CtrlShiftK mac中則…

局部放電試驗變頻電源

局部放電試驗中的變頻電源設備 局部放電試驗變頻電源是一種專為電力設備的局部放電檢測設計的高性能電源系統。在電力設備的運行和維護過程中&#xff0c;局部放電測試用于探測潛在的絕緣缺陷&#xff0c;防止它們進一步惡化導致設備損壞。傳統的局部放電試驗通常使用交流電源&…

with關鍵字

在 Python 中&#xff0c;with 是一個關鍵字&#xff0c;用于引入一個上下文管理器&#xff08;context manager&#xff09;。上下文管理器是一種特殊的對象&#xff0c;它允許你以一種干凈、結構化的方式執行一組特定的操作&#xff0c;通常包括設置和清理資源。 with 語句通…

jmeter之測試計劃

一、測試計劃作用 測試計劃是jmeter的默認控件所有線程組都是測試計劃的下級控件測試計劃可以配置用戶自定義的變量測試計劃可以配置線程組的串行或并行 二、查看界面 名稱&#xff1a;可以修改自定義的名稱注釋&#xff1a;解釋測試計劃是用來做什么的用戶自定義的變量&…

Sentinel重要的前置知識

文章目錄 1、雪崩問題及解決方案1.1、雪崩問題1.2、超時處理1.3、倉壁模式1.4、斷路器1.5、限流1.6、總結 2、服務保護技術對比3、Sentinel介紹和安裝3.1、初識Sentinel3.2、安裝Sentinel 4、微服務整合Sentinel ?&#x1f343;作者介紹&#xff1a;雙非本科大三網絡工程專業在…