summaryrefslogtreecommitdiff
path: root/src/qcam/assets/feathericons/info.svg
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-02-01 09:27:38 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-02-01 14:20:37 +0200
commite96d02015c3a2322ad0335b969d9cb6ee83e83d0 (patch)
treecac0f409e0cdeafd631feedcd3cb1c36e12953ae /src/qcam/assets/feathericons/info.svg
parent355f4145b87e9fcbdd908fc65d2ef8b9f0d7ddf1 (diff)
pipeline: raspberrypi: Fix the buffer count calculation for the ISP input stream
The ISP input stream currently only allocates a single slot in the V4L2VideoDevice cache as it follows the number of buffers allocated for use. However, this is wrong as the ISP input stream imports buffers from Unicam image stream. As a consequence of this, only one cache slot was used during runtime for the ISP input stream, and if multiple buffers were to be queued simultaneously, the queue operation would return a failure. Fix this by passing the same number of RAW buffers available from the Unicam image stream. Additionally, double this count in the cases where buffers could be allocated externally from the application. Bug: https://github.com/raspberrypi/libcamera-apps/issues/236 Bug: https://github.com/raspberrypi/libcamera-apps/issues/238 Bug: https://github.com/raspberrypi/libcamera-apps/issues/240 Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/qcam/assets/feathericons/info.svg')
0 files changed, 0 insertions, 0 deletions
="hl str"> iterate through macbeth square patches """ for ch_patches in Img.patches: for patch in ch_patches: """ renormalise patch """ patch = np.array(patch) patch = (patch-Img.blacklevel_16)/Img.againQ8_norm std = np.std(patch) mean = np.mean(patch) stds.append(std) means.append(mean) """ clean data and ensure all means are above 0 """ stds = np.array(stds) means = np.array(means) means = np.clip(np.array(means),0,None) sq_means = np.sqrt(means) """ least squares fit model """ fit = np.polyfit(sq_means,stds,1) Cam.log += '\nBlack level = {}'.format(Img.blacklevel_16) Cam.log += '\nNoise profile: offset = {}'.format(int(fit[1])) Cam.log += ' slope = {:.3f}'.format(fit[0]) """ remove any values further than std from the fit anomalies most likely caused by: > ucharacteristically noisy white patch > saturation in the white patch """ fit_score = np.abs(stds - fit[0]*sq_means - fit[1]) fit_std = np.std(stds) fit_score_norm = fit_score - fit_std anom_ind = np.where(fit_score_norm > 1) fit_score_norm.sort() sq_means_clean = np.delete(sq_means,anom_ind) stds_clean = np.delete(stds,anom_ind) removed = len(stds) - len(stds_clean) if removed != 0: Cam.log += '\nIdentified and removed {} anomalies.'.format(removed) Cam.log += '\nRecalculating fit' """ recalculate fit with outliers removed """ fit = np.polyfit(sq_means_clean,stds_clean,1) Cam.log += '\nNoise profile: offset = {}'.format(int(fit[1])) Cam.log += ' slope = {:.3f}'.format(fit[0]) """ if fit const is < 0 then force through 0 by dividing by sq_means and fitting poly order 0 """ corrected = 0 if fit[1] < 0: corrected = 1 ones = np.ones(len(means)) y_data = stds/sq_means fit2 = np.polyfit(ones,y_data,0) Cam.log += '\nOffset below zero. Fit recalculated with zero offset' Cam.log += '\nNoise profile: offset = 0' Cam.log += ' slope = {:.3f}'.format(fit2[0]) # print('new fit') # print(fit2) """ plot fit for debug """ if plot: x = np.arange(sq_means.max()//0.88) fit_plot = x*fit[0] + fit[1]