Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Census transformation #59

Open
Apeiria opened this issue Sep 8, 2020 · 2 comments
Open

Census transformation #59

Apeiria opened this issue Sep 8, 2020 · 2 comments

Comments

@Apeiria
Copy link

Apeiria commented Sep 8, 2020

Hello,

I have a question regarding census transformation when reading your code. Why aren't you comparing the intensity of neighboring pixels with the center?

Best regards.

Here is the code in census_transform.cu

// Compute and store
const int x = x0 + tid, y = y0 + i;
if(half_kw <= x && x < width - half_kw && half_kh <= y && y < height - half_kh){
	const int smem_x = tid;
	const int smem_y = (half_kh + i) % SMEM_BUFFER_SIZE;
	feature_type f = 0;
	for(int dy = -half_kh; dy < 0; ++dy){
		const int smem_y1 = (smem_y + dy + SMEM_BUFFER_SIZE) % SMEM_BUFFER_SIZE;
		const int smem_y2 = (smem_y - dy + SMEM_BUFFER_SIZE) % SMEM_BUFFER_SIZE;
		for(int dx = -half_kw; dx <= half_kw; ++dx){
			const int smem_x1 = smem_x + dx;
			const int smem_x2 = smem_x - dx;
			const auto a = smem_lines[smem_y1][smem_x1];
			const auto b = smem_lines[smem_y2][smem_x2];
			f = (f << 1) | (a > b);
		}
	}
	for(int dx = -half_kw; dx < 0; ++dx){
		const int smem_x1 = smem_x + dx;
		const int smem_x2 = smem_x - dx;
		const auto a = smem_lines[smem_y][smem_x1];
		const auto b = smem_lines[smem_y][smem_x2];
		f = (f << 1) | (a > b);
	}
	dest[x + y * width] = f;
}
@atakagi-fixstars
Copy link
Contributor

Hi, @Apeiria

Thank you for your question.
We are actually using Center-Symmetric Census Transform.
It compares only center-symmetric pairs of pixels.

For more information, please refer to this paper.
https://www.mi.fu-berlin.de/inf/groups/ag-ki/publications/Semi-Global_Matching/caip2013rsp_fu.pdf

Regards,

@Apeiria
Copy link
Author

Apeiria commented Sep 10, 2020

Hi, @Apeiria

Thank you for your question.
We are actually using Center-Symmetric Census Transform.
It compares only center-symmetric pairs of pixels.

For more information, please refer to this paper.
https://www.mi.fu-berlin.de/inf/groups/ag-ki/publications/Semi-Global_Matching/caip2013rsp_fu.pdf

Regards,

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants