Azzera filtri
Azzera filtri

Matlab to C code conversion

3 visualizzazioni (ultimi 30 giorni)
Itai Kadosh
Itai Kadosh il 6 Ott 2016
Risposto: BhaTTa circa 3 ore fa
Hi, I would like to convert a Matlab code to C code. My code supposed to make correction (in video) by Affine transform in the location of ROI that carried out in him a displacement and rotation. I used in "coder.screener" for checking which functions can't be converted to C and the coder found that there are 2 function which not supported for this conversion: 1. cvexEstStabilizationTform. 2. cvexTformToSRT. Are there other functions that replace them and supported in C conversion? Thanks, Itai

Risposte (1)

BhaTTa
BhaTTa circa 3 ore fa
Converting MATLAB code to C code using MATLAB Coder can sometimes be challenging, especially when dealing with functions that are not supported for code generation. In your case, the functions cvexEstStabilizationTform and cvexTformToSRT are not supported for conversion to C. However, you can often find alternative approaches or implement similar functionality manually.Alternative Approaches
  1. Estimate Affine Transformation:
  • If cvexEstStabilizationTform is used for estimating an affine transformation, you can use basic MATLAB functions that are supported for code generation. Consider using functions like fitgeotrans to estimate geometric transformations, which you may need to implement manually if not supported directly.
  • Alternatively, you can use feature detection and matching techniques (e.g., detectSURFFeatures, matchFeatures) to compute transformation parameters.
2. Decompose Affine Transformation:
  • For cvexTformToSRT, which likely decomposes an affine transformation into scale, rotation, and translation components, you can manually extract these parameters from the affine transformation matrix.
Below is the documentation link to MATLAB Coder:

Categorie

Scopri di più su Operators and Elementary Operations in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by