We present a fast and reconfigurable architecture of centroiding for wavefront sensing implemented in FPGA, with a short latency in the order of microseconds, due to the tight integration design of a CMOS image sensor and the FPGA, and the fast algorithm implementation. Data are processed straight away as they arrive, so there is no need to use external storage in a high capacity memory, that will generate inconvenient delays for real time applications. In this architecture data are processed in a pipeline or parallel fashion when convenient, by means of a stream processing with moving filters algorithm (SCoG), or fixed regions in the image sensor typical from a Shack-Hartmann array using the 1st Fourier Coefficient (1FC). In this work timing and performance of both algorithms are presented, as well as on-sky tests when attached to a 12-inch Meade LX200 telescope aiming for bright stars. The results show a latency no longer than 10 microseconds, for a region of 300 pixels per row in the image sensor. These architecture provide a promising solution as a part of an adaptive optics system design for astronomy and space situational awareness applications. Possible applications are astronomy and space situational awareness. We show some preliminary results for on-sky tests using these two centroiding algorithms.