在 C++ 中,struct(結構體)是一種用來建立自訂資料型別的工具,可以把多個不同型別的資料包在一起。這在處理一組有邏輯關聯的資料時非常有用。
✅ 基本語法
struct Point {
int x;
int y;
};
這樣就定義了一個名叫 Point 的結構體,裡面有兩個整數成員:x 和 y。
使用方法如下:
ref:
linux2021 Concurrency Study -- SPMC
spmc
spmc_enqueue
if (!IS_WRITABLE(idx, node)) {
spmc_node_t *const next =
atomic_load_explicit(&node->next, memory_order_relaxed);
/* Never move to write on top of the node that is currently being read;
* In that case, items would be read out of order they were enqueued.
JeffBla changed 3 months agoView mode Like Bookmark
contributed by < JeffBla >
Q1 間接指標、鏈結串列與記憶體配置
測驗 1
解釋程式碼運作的原理
/**
* Inserts a new item into the list before a specified item.
*
* This function traverses the list to locate the position immediately before
* the item pointed to by @before and inserts @item in that position.
JeffBla changed 4 months agoView mode Like Bookmark
Identification-of-core-XCT-photographs.md
Intro
For now, due to its convenience and simplicity, I use Python to design the algorithm and find the solution to this program.
What I have done:
Read dicom images.
Extracte the data in the dicom files, such as pixel, rescale slope and rescale intercept.
Use the extracted data to calculate CT value by the formula:Hu = pixel * rescale slope + rescale intercept
Scale the value of pixel data into 0~255, so that we can apply image processing algorithms to this gray image.
JeffBla changed 2 years agoEdit mode Like Bookmark
Extracte the data in the dicom files, such as pixel, rescale slope and rescale intercept.
Use the extracted data to calculate CT value by the formula:Hu = pixel * rescale slope + rescale intercept
Scale the value of pixel data into 0~255, so that we can apply image processing algorithms to this gray image.
Use image processing algorithms to find the target
make the image blur
use Canny algorithms to find the edge of the image
find the inner circle of the rock container by Circle Hough TransformInner circle of the rock container fliter out the rock container when calculating porosity later
Threshold the image to create a binary image
JeffBla changed 2 years agoEdit mode Like Bookmark