Aqueti / mantis_examples

Example software to demonstrate functionality of the Aqueti MantisAPI
https://aqueti.tv/api
MIT License
5 stars 2 forks source link

Should check the resolution before calculating metric in AutoFocus #18

Closed yuanxy92 closed 7 years ago

yuanxy92 commented 7 years ago

FRAME frame = grabMCamFrame(portbase+j, 1.0 ); int imgsize = frame.m_metadata.m_size; size_t step=CV_AUTO_STEP; Mat rawdata = Mat(1, imgsize , CV_8UC1, (void *)frame.m_image); //compressed jpg data Mat loaded = imdecode(rawdata,1);

This code sometimes captures 4K image and sometimes only captures HD image. The canny based metric used in this code is much smaller on HD image than on 4K image (especially in night).

Therefore, I think it is necessary to check the size before calculating the metric. If it is not 4K, capture a new one. Besides, I think we can try to use bilateral filter for night image.

sfeller commented 7 years ago

@bmaione, this may be resolved. Assigning to you for information about the status of this bug and where to fix it (if it hasn't been)