|
|
@ -1529,7 +1529,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
|
|
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power ON");
|
|
|
|
XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power ON");
|
|
|
|
std::shared_ptr<PowerControl> ethernetPowerCtrl = std::make_shared<EthernetPowerCtrl>(1);
|
|
|
|
std::shared_ptr<PowerControl> ethernetPowerCtrl = std::make_shared<EthernetPowerCtrl>(1);
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
|
|
|
SetStaticIp();
|
|
|
|
SetStaticIp();
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(256));
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(256));
|
|
|
|
|
|
|
|
|
|
|
@ -2179,6 +2179,10 @@ void visualize(const char* filename, const ncnn::Mat& m)
|
|
|
|
|
|
|
|
|
|
|
|
void DrawOutlineText(cv::Ptr<cv::ft::FreeType2> ft2, cv::Mat& mat, const std::string& str, cv::Point startPoint, int fontSize, cv::Scalar clr, int thickness)
|
|
|
|
void DrawOutlineText(cv::Ptr<cv::ft::FreeType2> ft2, cv::Mat& mat, const std::string& str, cv::Point startPoint, int fontSize, cv::Scalar clr, int thickness)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (mat.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
std::vector<std::string> lines = split(str, "\n");
|
|
|
|
std::vector<std::string> lines = split(str, "\n");
|
|
|
|
int lineHeight = 0;
|
|
|
|
int lineHeight = 0;
|
|
|
|
cv::Point pt = startPoint;
|
|
|
|
cv::Point pt = startPoint;
|
|
|
@ -2258,6 +2262,13 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics
|
|
|
|
closeThread.detach();
|
|
|
|
closeThread.detach();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rgb.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "Empty Mat object CH=%u IMGID=%u", (uint32_t)photoInfo.channel, (uint32_t)photoInfo.photoId);
|
|
|
|
|
|
|
|
TakePhotoCb(0, photoInfo, "", takingTime);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CPhoneDevice* pThis = this;
|
|
|
|
CPhoneDevice* pThis = this;
|
|
|
|
std::thread th([pThis, characteristics, result, photoInfo, osds, path, rgb, facing, sensorOrientation, ldr, duration, takingTime]()
|
|
|
|
std::thread th([pThis, characteristics, result, photoInfo, osds, path, rgb, facing, sensorOrientation, ldr, duration, takingTime]()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2701,11 +2712,21 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cv::cvtColor(rgb, rgb, cv::COLOR_RGB2BGR);
|
|
|
|
cv::cvtColor(rgb, rgb, cv::COLOR_RGB2BGR);
|
|
|
|
#endif // USING_EXEC_HDRP
|
|
|
|
#endif // USING_EXEC_HDRP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rgb.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "Empty Mat object CH=%u IMGID=%u", (uint32_t)photoInfo.channel, (uint32_t)photoInfo.photoId);
|
|
|
|
|
|
|
|
pThis->TakePhotoCb(0, photoInfo, path, takingTime);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb);
|
|
|
|
bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb);
|
|
|
|
if (res)
|
|
|
|
if (res)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// TakePhotoCb(2, photoInfo, path, takingTime);
|
|
|
|
// TakePhotoCb(2, photoInfo, path, takingTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
th.detach();
|
|
|
|
th.detach();
|
|
|
@ -3015,11 +3036,20 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
cv::cvtColor(rgb, rgb, cv::COLOR_RGB2BGR);
|
|
|
|
cv::cvtColor(rgb, rgb, cv::COLOR_RGB2BGR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (rgb.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "Empty Mat object CH=%u IMGID=%u", (uint32_t)photoInfo.channel, (uint32_t)photoInfo.photoId);
|
|
|
|
|
|
|
|
pThis->TakePhotoCb(0, photoInfo, path, takingTime);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb);
|
|
|
|
bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb);
|
|
|
|
if (res)
|
|
|
|
if (res)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// TakePhotoCb(2, photoInfo, path, takingTime);
|
|
|
|
// TakePhotoCb(2, photoInfo, path, takingTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
th.detach();
|
|
|
|
th.detach();
|
|
|
|