ms-tpm-20-ref 在linux下编译

1、代码地址,  GitHub - microsoft/ms-tpm-20-ref: Reference implementation of the TCG Trusted Platform Module 2.0 specification.Reference implementation of the TCG Trusted Platform Module 2.0 specification. - GitHub - microsoft/ms-tpm-20-ref: Reference implementation of the TCG Trusted Platform Module 2.0 specification.https://github.com/microsoft/ms-tpm-20-ref

2、解压后编译

(1)  cd到TPMCmd目录下面, cd xxxx/ms-tpm-20-ref/ms-tpm-20-ref-main/TPMCmd

 (2) ./bootstrap

./bootstrap 一般做了什么呢 ? :

        ./bootstrap 是一个常见的在 Unix 或 Linux 系统中用于初始化项目的脚本。具体做了什么取决于脚本的内容,但一般来说,它可能会做以下几件事:

1. 检查系统环境:检查是否安装了必要的软件和库,如果没有,可能会提示用户安装。

2. 配置项目:设置项目的环境变量,生成配置文件等。

3. 构建项目:编译源代码,生成可执行文件。

4. 安装依赖:如果项目有依赖其他库或者项目,./bootstrap 可能会自动下载并安装这些依赖。

这只是一般情况,具体的 ./bootstrap 脚本可能会根据项目的需要做更多的事情。如果你想了解一个具体的 ./bootstrap 脚本做了什么,你可以打开它看看脚本的内容。

(3)./configure

 如果需要去掉warn当error ,打开Makefile文件 ,找到 EXTRA_CFLAGS 去掉 -Werror

如果需要添加其它main函数:

1、首先把TPMCmds.c中的main函数改个名比如main333

2、把 其它main函数拷贝到 TPMCmds.c中 或者 CryptRsa.c中 ,比如:

int
main(int              argc,char* argv[]
)
{int		i;int		irc;printf("C:begin genRsaKey\n");UINT32               e = 0;TPMT_PUBLIC  publicArea;TPMT_SENSITIVE sensitive;RAND_STATE rand;printf("C:keyLengthInBitssxxxx  \n");unsigned char c[] = { 0xBC, 0xEF, 0x25, 0xFD, 0xD9, 0xB2, 0xDF, 0x0C, 0xEE, 0x50, 0x1C, 0x5D, 0xBD, 0xB4, 0x6B, 0x66, 0x1F, 0xBB, 0xB6, 0xD8, 0x3F, 0x4B, 0xF3, 0x2B, 0xD7, 0x06, 0x65, 0x9A, 0xE0, 0x96, 0xBD, 0xA5, 0xC7, 0xBC, 0x17, 0xBF, 0x2E, 0x9B, 0x2D, 0x8E, 0x29, 0xF8, 0x99, 0x13, 0x77, 0xAC, 0xD0, 0x4B };memset(rand.drbg.seed.bytes, 0,48);memcpy(rand.drbg.seed.bytes, c, 48);rand.drbg.magic = DRBG_MAGIC;rand.drbg.reseedCounter = 0x0000000000000064;publicArea.parameters.rsaDetail.exponent = 0;publicArea.parameters.rsaDetail.keyBits = 2048;publicArea.type = 1;publicArea.nameAlg = 11;publicArea.objectAttributes = 0x000300b2;publicArea.authPolicy.t.size = 32;TPMS_RSA_PARMS rsaParms = publicArea.parameters.rsaDetail;rsaParms.keyBits = 0x800;rsaParms.exponent = 0;rsaParms.symmetric.algorithm = 0x06;TPMU_SYM_KEY_BITS keyBits = rsaParms.symmetric.keyBits;keyBits.aes = 0x80;keyBits.camellia = 0x80;keyBits.sym = 0x80;keyBits.xor = 0x80;TPMU_SYM_MODE mode =  rsaParms.symmetric.mode;mode.aes = 0x43;mode.camellia = 0x43;mode.sym = 0x43;rsaParms.scheme.scheme = 0x10;rsaParms.scheme.details.rsapss.hashAlg = 0;sensitive.sensitiveType = 1;sensitive.authValue.t.size = 32;sensitive.seedValue.t.size = 0;sensitive.sensitive.rsa.t.size = 0;TPM_RC ret = CryptRsaGenerateKey(&publicArea,&sensitive,&rand);printf("C:CryptRsaGenerateKey = %d \n", ret);return ret;
}

(4)make

  make 完成后会生成 xxx.a文件:

Platform/src/libplatform.a

tpm/src/libtpm.a

Platform/src/libplatform.a

(5)

make完成后能看到 生成libtpm.a 的指令:

ar cru tpm/src/libtpm.a tpm/src/X509/tpm_src_libtpm_a-TpmASN1.o tpm/src/X509/tpm_src_libtpm_a-X509_ECC.o tpm/src/X509/tpm_src_libtpm_a-X509_RSA.o tpm/src/X509/tpm_src_libtpm_a-X509_spt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECC_Decrypt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECC_Encrypt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECC_Parameters.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECDH_KeyGen.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECDH_ZGen.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-EC_Ephemeral.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-RSA_Decrypt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-RSA_Encrypt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ZGen_2Phase.o tpm/src/command/AttachedComponent/tpm_src_libtpm_a-AC_GetCapability.o tpm/src/command/AttachedComponent/tpm_src_libtpm_a-AC_Send.o tpm/src/command/AttachedComponent/tpm_src_libtpm_a-AC_spt.o tpm/src/command/AttachedComponent/tpm_src_libtpm_a-Policy_AC_SendSelect.o tpm/src/command/Attestation/tpm_src_libtpm_a-Attest_spt.o tpm/src/command/Attestation/tpm_src_libtpm_a-Certify.o tpm/src/command/Attestation/tpm_src_libtpm_a-CertifyCreation.o tpm/src/command/Attestation/tpm_src_libtpm_a-CertifyX509.o tpm/src/command/Attestation/tpm_src_libtpm_a-GetCommandAuditDigest.o tpm/src/command/Attestation/tpm_src_libtpm_a-GetSessionAuditDigest.o tpm/src/command/Attestation/tpm_src_libtpm_a-GetTime.o tpm/src/command/Attestation/tpm_src_libtpm_a-Quote.o tpm/src/command/Capability/tpm_src_libtpm_a-GetCapability.o tpm/src/command/Capability/tpm_src_libtpm_a-TestParms.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ACT_SetTimeout.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ACT_spt.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ClockRateAdjust.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ClockSet.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ReadClock.o tpm/src/command/CommandAudit/tpm_src_libtpm_a-SetCommandCodeAuditStatus.o tpm/src/command/Context/tpm_src_libtpm_a-ContextLoad.o tpm/src/command/Context/tpm_src_libtpm_a-ContextSave.o tpm/src/command/Context/tpm_src_libtpm_a-Context_spt.o tpm/src/command/Context/tpm_src_libtpm_a-EvictControl.o tpm/src/command/Context/tpm_src_libtpm_a-FlushContext.o tpm/src/command/DA/tpm_src_libtpm_a-DictionaryAttackLockReset.o tpm/src/command/DA/tpm_src_libtpm_a-DictionaryAttackParameters.o tpm/src/command/Duplication/tpm_src_libtpm_a-Duplicate.o tpm/src/command/Duplication/tpm_src_libtpm_a-Import.o tpm/src/command/Duplication/tpm_src_libtpm_a-Rewrap.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyAuthValue.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyAuthorize.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyAuthorizeNV.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyCommandCode.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyCounterTimer.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyCpHash.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyDuplicationSelect.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyGetDigest.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyLocality.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyNV.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyNameHash.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyNvWritten.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyOR.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyPCR.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyPassword.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyPhysicalPresence.o tpm/src/command/EA/tpm_src_libtpm_a-PolicySecret.o tpm/src/command/EA/tpm_src_libtpm_a-PolicySigned.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyTemplate.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyTicket.o tpm/src/command/EA/tpm_src_libtpm_a-Policy_spt.o tpm/src/command/Ecdaa/tpm_src_libtpm_a-Commit.o tpm/src/command/FieldUpgrade/tpm_src_libtpm_a-FieldUpgradeData.o tpm/src/command/FieldUpgrade/tpm_src_libtpm_a-FieldUpgradeStart.o tpm/src/command/FieldUpgrade/tpm_src_libtpm_a-FirmwareRead.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-EventSequenceComplete.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-HMAC_Start.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-HashSequenceStart.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-MAC_Start.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-SequenceComplete.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-SequenceUpdate.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-ChangeEPS.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-ChangePPS.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-Clear.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-ClearControl.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-CreatePrimary.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-HierarchyChangeAuth.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-HierarchyControl.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-SetPrimaryPolicy.o tpm/src/command/Misc/tpm_src_libtpm_a-PP_Commands.o tpm/src/command/Misc/tpm_src_libtpm_a-SetAlgorithmSet.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Certify.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_ChangeAuth.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_DefineSpace.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Extend.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_GlobalWriteLock.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Increment.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Read.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_ReadLock.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_ReadPublic.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_SetBits.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_UndefineSpace.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_UndefineSpaceSpecial.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Write.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_WriteLock.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_spt.o tpm/src/command/Object/tpm_src_libtpm_a-ActivateCredential.o tpm/src/command/Object/tpm_src_libtpm_a-Create.o tpm/src/command/Object/tpm_src_libtpm_a-CreateLoaded.o tpm/src/command/Object/tpm_src_libtpm_a-Load.o tpm/src/command/Object/tpm_src_libtpm_a-LoadExternal.o tpm/src/command/Object/tpm_src_libtpm_a-MakeCredential.o tpm/src/command/Object/tpm_src_libtpm_a-ObjectChangeAuth.o tpm/src/command/Object/tpm_src_libtpm_a-Object_spt.o tpm/src/command/Object/tpm_src_libtpm_a-ReadPublic.o tpm/src/command/Object/tpm_src_libtpm_a-Unseal.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Allocate.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Event.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Extend.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Read.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Reset.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_SetAuthPolicy.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_SetAuthValue.o tpm/src/command/Random/tpm_src_libtpm_a-GetRandom.o tpm/src/command/Random/tpm_src_libtpm_a-StirRandom.o tpm/src/command/Session/tpm_src_libtpm_a-PolicyRestart.o tpm/src/command/Session/tpm_src_libtpm_a-StartAuthSession.o tpm/src/command/Signature/tpm_src_libtpm_a-Sign.o tpm/src/command/Signature/tpm_src_libtpm_a-VerifySignature.o tpm/src/command/Startup/tpm_src_libtpm_a-Shutdown.o tpm/src/command/Startup/tpm_src_libtpm_a-Startup.o tpm/src/command/Symmetric/tpm_src_libtpm_a-EncryptDecrypt.o tpm/src/command/Symmetric/tpm_src_libtpm_a-EncryptDecrypt2.o tpm/src/command/Symmetric/tpm_src_libtpm_a-EncryptDecrypt_spt.o tpm/src/command/Symmetric/tpm_src_libtpm_a-HMAC.o tpm/src/command/Symmetric/tpm_src_libtpm_a-Hash.o tpm/src/command/Symmetric/tpm_src_libtpm_a-MAC.o tpm/src/command/Testing/tpm_src_libtpm_a-GetTestResult.o tpm/src/command/Testing/tpm_src_libtpm_a-IncrementalSelfTest.o tpm/src/command/Testing/tpm_src_libtpm_a-SelfTest.o tpm/src/command/Vendor/tpm_src_libtpm_a-Vendor_TCG_Test.o tpm/src/crypt/tpm_src_libtpm_a-AlgorithmTests.o tpm/src/crypt/tpm_src_libtpm_a-BnConvert.o tpm/src/crypt/tpm_src_libtpm_a-BnMath.o tpm/src/crypt/tpm_src_libtpm_a-BnMemory.o tpm/src/crypt/tpm_src_libtpm_a-CryptCmac.o tpm/src/crypt/tpm_src_libtpm_a-CryptDes.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccCrypt.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccData.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccKeyExchange.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccMain.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccSignature.o tpm/src/crypt/tpm_src_libtpm_a-CryptHash.o tpm/src/crypt/tpm_src_libtpm_a-CryptPrime.o tpm/src/crypt/tpm_src_libtpm_a-CryptPrimeSieve.o tpm/src/crypt/tpm_src_libtpm_a-CryptRand.o tpm/src/crypt/tpm_src_libtpm_a-CryptRsa.o tpm/src/crypt/tpm_src_libtpm_a-CryptSelfTest.o tpm/src/crypt/tpm_src_libtpm_a-CryptSmac.o tpm/src/crypt/tpm_src_libtpm_a-CryptSym.o tpm/src/crypt/tpm_src_libtpm_a-CryptUtil.o tpm/src/crypt/tpm_src_libtpm_a-PrimeData.o tpm/src/crypt/tpm_src_libtpm_a-RsaKeyCache.o tpm/src/crypt/tpm_src_libtpm_a-Ticket.o tpm/src/crypt/ltc/tpm_src_libtpm_a-TpmToLtcDesSupport.o tpm/src/crypt/ltc/tpm_src_libtpm_a-TpmToLtcMath.o tpm/src/crypt/ltc/tpm_src_libtpm_a-TpmToLtcSupport.o tpm/src/crypt/ossl/tpm_src_libtpm_a-TpmToOsslDesSupport.o tpm/src/crypt/ossl/tpm_src_libtpm_a-TpmToOsslMath.o tpm/src/crypt/ossl/tpm_src_libtpm_a-TpmToOsslSupport.o tpm/src/crypt/wolf/tpm_src_libtpm_a-TpmToWolfDesSupport.o tpm/src/crypt/wolf/tpm_src_libtpm_a-TpmToWolfMath.o tpm/src/crypt/wolf/tpm_src_libtpm_a-TpmToWolfSupport.o tpm/src/events/tpm_src_libtpm_a-_TPM_Hash_Data.o tpm/src/events/tpm_src_libtpm_a-_TPM_Hash_End.o tpm/src/events/tpm_src_libtpm_a-_TPM_Hash_Start.o tpm/src/events/tpm_src_libtpm_a-_TPM_Init.o tpm/src/main/tpm_src_libtpm_a-CommandDispatcher.o tpm/src/main/tpm_src_libtpm_a-ExecCommand.o tpm/src/main/tpm_src_libtpm_a-SessionProcess.o tpm/src/subsystem/tpm_src_libtpm_a-CommandAudit.o tpm/src/subsystem/tpm_src_libtpm_a-DA.o tpm/src/subsystem/tpm_src_libtpm_a-Hierarchy.o tpm/src/subsystem/tpm_src_libtpm_a-NvDynamic.o tpm/src/subsystem/tpm_src_libtpm_a-NvReserved.o tpm/src/subsystem/tpm_src_libtpm_a-Object.o tpm/src/subsystem/tpm_src_libtpm_a-PCR.o tpm/src/subsystem/tpm_src_libtpm_a-PP.o tpm/src/subsystem/tpm_src_libtpm_a-Session.o tpm/src/subsystem/tpm_src_libtpm_a-Time.o tpm/src/support/tpm_src_libtpm_a-AlgorithmCap.o tpm/src/support/tpm_src_libtpm_a-Bits.o tpm/src/support/tpm_src_libtpm_a-CommandCodeAttributes.o tpm/src/support/tpm_src_libtpm_a-Entity.o tpm/src/support/tpm_src_libtpm_a-Global.o tpm/src/support/tpm_src_libtpm_a-Handle.o tpm/src/support/tpm_src_libtpm_a-IoBuffers.o tpm/src/support/tpm_src_libtpm_a-Locality.o tpm/src/support/tpm_src_libtpm_a-Manufacture.o tpm/src/support/tpm_src_libtpm_a-Marshal.o tpm/src/support/tpm_src_libtpm_a-MathOnByteBuffers.o tpm/src/support/tpm_src_libtpm_a-Memory.o tpm/src/support/tpm_src_libtpm_a-Power.o tpm/src/support/tpm_src_libtpm_a-PropertyCap.o tpm/src/support/tpm_src_libtpm_a-Response.o tpm/src/support/tpm_src_libtpm_a-ResponseCodeProcessing.o tpm/src/support/tpm_src_libtpm_a-TableDrivenMarshal.o tpm/src/support/tpm_src_libtpm_a-TableMarshalData.o tpm/src/support/tpm_src_libtpm_a-TpmFail.o tpm/src/support/tpm_src_libtpm_a-TpmSizeChecks.o   


5.1 如果需要把tpm模块编译成 可执行文件则:

ar指令前面改成: gcc  -fPIC -L Platform/src/ -L tpm/src/ -o tpm/src/libtpmExeMS

后面添加:   -lcrypto -lplatform -ltpm   (注意不能在前面加,否则会报符号找不到)

5.2 如果需要编译成 动态库.so文件则:

ar指令前面改成:gcc  -fPIC -L Platform/src/ -L tpm/src/  -shared  -o tpm/src/libtpm2.so 

后面添加:  -lcrypto -lplatform -ltpm (注意不能在前面加,否则会报符号找不到)

5.3  make后会把Simulator模块编译成可执行文件

gcc -std=gnu11  -Wall -Wformat-security -fstack-protector-all -fPIC -Wno-error=empty-body -Wno-error=parentheses -Wno-error=pointer-to-int-cast -Wno-error=missing-braces -Wno-error=unused-result -I ./Platform/include -I ./Platform/include/prototypes -I ./tpm/include -I ./tpm/include/prototypes -I ./Simulator/include -I ./Simulator/include/prototypes  -pthread -g -O2   -o Simulator/src/tpm2-simulator Simulator/src/Simulator_src_tpm2_simulator-TPMCmdp.o Simulator/src/Simulator_src_tpm2_simulator-TPMCmds.o Simulator/src/Simulator_src_tpm2_simulator-TcpServer.o  Platform/src/libplatform.a tpm/src/libtpm.a Platform/src/libplatform.a -lcrypto

其中,

输出为:Simulator/src/tpm2-simulator

输入为;

Simulator 目录下的3个.o文件

3个静态库.a和openssl库crypto

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/86607.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

技术的巅峰演进:深入解析算力网络的多层次技术设计

在数字化时代的浪潮中,网络技术正以前所未有的速度演进,而算力网络作为其中的一颗明星,以其多层次的技术设计引领着未来的网络构架。本文将带您深入探索算力网络独特的技术之旅,从底层协议到分布式控制,为您呈现这一创…

postman-使用Postman的模拟服务来模拟(mock)后端数据,完成前端模拟API调用

最近项目上比较忙,任务多时间紧,导致后端开发任务繁多,无法及时开发完毕,但是前端同学已经把对应功能开发完成,需要进行前后端联调来验证API及一些交互问题;这不能因为后端的进度来影响前端的工作完成情况&…

财务数据分析怎么做?看看奥威BI数据可视化工具的解法

从以往的BI智能数据可视化分析项目来看,要想快刀砍乱麻地做好财务数据分析,为企业运营决策提供更加直观深入的数据支持,那就需要为财务数据分析做好数据导入、建模、报表制作、展示等多方面的准备。奥威BI数据可视化工具为此特意打造了一套标…

窗口看门狗

从下往上看: 1. 时钟设置 RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG,ENABLE);//使能独立看门狗时钟 WWDG_SetPrescaler(WWDG_Prescaler_8);//看门狗预分频器WWDG counter clock (PCLK1/4096)/8 2.设置窗口值 实际就是设置WWDG_CR的低七位值, 但是这个值要大于0x40(也就是…

使用 MATLAB 和 Simulink 对雷达系统进行建模和仿真

💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭&a…

opencv 进阶20-随机森林示例

OpenCV中的随机森林是一种强大的机器学习算法,旨在解决分类和回归问题。随机森林使用多个决策树来进行预测,每个决策树都是由随机选择的样本和特征组成的。在分类问题中,随机森林通过投票来确定最终的类别;在回归问题中&#xff0…

深度学习怎么学?

推荐这本小白看的《深度学习:从基础到实践(上下册)》。 深度学习:从基础到实践(上下册) 深入浅出的讲述了深度学习的基本概念与理论知识,不涉及复杂的数学内容,零基础小白也能轻松掌…

人员着装识别算法 yolo

人员着装识别系统通过yolo网络模型识别算法,人员着装识别系统算法通过现场安装的摄像头识别工厂人员及工地人员是否按要求穿戴着装,实时监测人员的着装情况,并进行相关预警。目标检测架构分为两种,一种是two-stage,一种…

win10系统rust串口通信实现

一、用cargo创建新工程 命令&#xff1a;cargo new comport use std::env; use std::{thread, time}; use serialport::{DataBits, StopBits, Parity, FlowControl}; use std::io::{self, Read, Write}; use std::time::Duration;fn main() -> io::Result<()> {let m…

Matlab图像处理-乘法运算

乘法运算 两幅图像进行乘法运算主要实现两个功能&#xff1a; 一是可以实现掩模操作&#xff0c;即屏蔽图像的某些部分&#xff1b; 二是如果一幅图像乘以一个常数因子&#xff0c;如果常数因子大于1&#xff0c;将增强图像的亮度&#xff0c;如果因子小于1则会使图像变暗。…

linux top命令的参数解释

参考&#xff1a; https://blog.csdn.net/weixin_45465395/article/details/115728520?ydrefereraHR0cHM6Ly9jbi5iaW5nLmNvbS8%3D 上面的一列是总的CPU使用情况&#xff0c;id是指的总的空闲的 内容 含义 0.0%us 用户空间占用CPU百分比 0.0%sy 内核空间占用CPU百分比 0.0%ni…

ip地址查询进行企业网络数据管理

在现代企业中&#xff0c;数据管理变得越来越重要。企业需要了解和控制其网络上的各种数据流动&#xff0c;以保护敏感信息并提高网络安全性。IP地址查询是一种常用的技术&#xff0c;可以帮助企业有效地管理网络数据&#xff0c;并识别潜在的威胁。 IP地址查询是通过查找特定I…