Hard hat detection function detects people who are not wearing hard hats in a specific region. You can configure the arming schedule and linkage actions to be taken when the hard hat detection alarms are triggered. For people who are not wearing hard hat, you can also link face picture libraries with the hard hat detection to recognize these people and know their names.
Make sure you have called NET_DVR_Init to initialize the development environment.
Make sure you have called NET_DVR_Login_V40 to log in to the device.
Make sure you have set the analysis engine mode to hard hat detection.
Call NET_DVR_STDXMLConfig to transmit the request URI: GET /ISAPI/Intelligent/capabilities. The intelligent capability is returned in the message XML_IntelliCap by lpOutputParam.
If the node <isSupportSafetyHelmetDetection> is returned and its value is "true", it indicates that the hard hat detection is supported, and then you can continue to perform the following steps. Otherwise, the hard hat detection is not supported by the device, please end this task.
Call NET_DVR_GetDeviceAbility, set the capability type (dwAbilityType) to "VCA_DEV_ABILITY" (macro definition value: 0x100) to get the intelligent device capability.
The intelligent device capability is returned in the structure NET_VCA_DEV_ABILITY by pOutBuf, and the related member is bySafetyHelmetDetection.
The configuration capability is returned in the message XML_SafetyHelmetDetectionCap by lpOutputParam.
Before setting parameters, you can get the default or configured parameters for reference by calling NET_DVR_STDXMLConfig to transmit the request URI: GET /ISAPI/Intelligent/channels/<ID>/safetyHelmetDetection. And the parameters are returned in the message XML_SafetyHelmetDetection by lpOutputParam.
To check whether setting advanced parameters is supported, you can check whether the node <AdvanceConfiguration> exists in the configuration capability message of hard hat detection XML_SafetyHelmetDetectionCap.
Before setting parameters, you can get the default or configured parameters for reference by calling NET_DVR_STDXMLConfig to transmit the request URI: GET /ISAPI/Intelligent/channels/<ID>/safetyHelmetDetection/advanceConfiguration. And the parameters are returned in the message XML_AdvanceConfiguration by lpOutputParam.
The arming schedule configuration capability (XML_Cap_Schedule) is returned by the output parameter lpOutBuffer in the structure NET_DVR_STD_ABILITY.
The arming schedule parameters (NET_DVR_EVENT_SCHEDULE) are returned by the output parameter lpOutBuffer in the structure NET_DVR_STD_CONFIG.
The alarm linkage configuration capability (XML_EventTriggersCap) is returned by the output parameter lpOutBuffer in the structure NET_DVR_STD_ABILITY.
The alarm linkage parameters (NET_DVR_EVENT_TRIGGER) are returned by the output parameter lpOutBuffer in the structure NET_DVR_STD_CONFIG.
The above detection parameters, arming schedule, and alarm linkages can be configured by logging in to the device via web browser.
The hard hat detection alarms are uploaded in the message JSON_EventNotificationAlert_safetyHelmetDetection.
To check whether searching for hard hat detection events is supported, you can check whether the node <SearchDescriptionCap> exists in the configuration capability message of hard hat detection XML_SafetyHelmetDetectionCap.
The search results are returned in the message JSON_SearchResult by lpOutputParam.
Call NET_DVR_Logout and NET_DVR_Cleanup to log out of the device and release resources.