Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
playground:doxycode [2024/01/20 19:02] lprobsth1playground:doxycode [2024/01/21 15:06] (current) – fix language lprobsth1
Line 1: Line 1:
-|< 1400px 50% 50%>|+|< 100% min:1000px 50% 50%>|
 ^  Dokuwiki/GeSHi  ^  Doxycode  ^ ^  Dokuwiki/GeSHi  ^  Doxycode  ^
-| <file c test2.c>+| The following example shows some C code from our custom library. Unfortunately the doxygen instance is not publicly available. || 
 +| <file c test.c>
 #include "canopen_dictionary.h" #include "canopen_dictionary.h"
    
Line 24: Line 25:
     TEST_ASSERT_MESSAGE(error==CANOPEN_DICTIONARY_LIB_ERROR_NONE,"the callback could not be registered");     TEST_ASSERT_MESSAGE(error==CANOPEN_DICTIONARY_LIB_ERROR_NONE,"the callback could not be registered");
 } }
-</file> | <doxycode tagfiles="canopen_dictionary_lib" test2.c>+</file> | <doxycode tagfiles="canopen_dictionary_lib" test.c>
 #include "canopen_dictionary.h" #include "canopen_dictionary.h"
    
Line 48: Line 49:
 } }
 </doxycode> | </doxycode> |
-| <file c [enable_line_numbers="true"test.c>+| Here the same example - but with linenumbers enabled. The doxycode code snippet uses the same XML cache file as the example above. || 
 +| <file c [enable_line_numbers="true"test2.c>
 #include "canopen_dictionary.h" #include "canopen_dictionary.h"
    
Line 71: Line 73:
     TEST_ASSERT_MESSAGE(error==CANOPEN_DICTIONARY_LIB_ERROR_NONE,"the callback could not be registered");     TEST_ASSERT_MESSAGE(error==CANOPEN_DICTIONARY_LIB_ERROR_NONE,"the callback could not be registered");
 } }
-</file> | <doxycode tagfiles="canopen_dictionary_lib" linenumbers test.c>+</file> | <doxycode tagfiles="canopen_dictionary_lib" linenumbers test2.c>
 #include "canopen_dictionary.h" #include "canopen_dictionary.h"
    
Line 95: Line 97:
 } }
 </doxycode> | </doxycode> |
 +| <WRAP>
 +The following example is taken from [[https://docs.opencv.org/4.x/d5/dae/tutorial_aruco_detection.html]]. \\ The tag file from [[https://docs.opencv.org/4.8.0/opencv.tag]] is used for referencing the documentation. \\
 +Building the snippet through the task runner is enabled globally for the tag file.
 +</WRAP> ||
 +| <code c>
 +#include <opencv2/aruco.hpp>
 +cv::VideoCapture inputVideo;
 +inputVideo.open(0);
 +cv::aruco::DetectorParameters detectorParams = cv::aruco::DetectorParameters();
 +cv::aruco::Dictionary dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_6X6_250);
 +cv::aruco::ArucoDetector detector(dictionary, detectorParams);
  
- +while (inputVideo.grab()) { 
- +    cv::Mat image, imageCopy; 
- +    inputVideo.retrieve(image); 
-<doxycode tagfiles="opencv4.8.0" opencv.cpp>+    image.copyTo(imageCopy); 
 +    std::vector<int> ids; 
 +    std::vector<std::vector<cv::Point2f>> corners, rejected; 
 +    detector.detectMarkers(image, corners, ids, rejected); 
 +    // if at least one marker detected 
 +    if (ids.size() > 0) 
 +        cv::aruco::drawDetectedMarkers(imageCopy, corners, ids); 
 +    cv::imshow("out", imageCopy); 
 +    char key = (char) cv::waitKey(waitTime); 
 +    if (key == 27) 
 +        break; 
 +
 +</code><doxycode tagfiles="opencv4.8.0" language=cpp>
 #include <opencv2/aruco.hpp> #include <opencv2/aruco.hpp>
 cv::VideoCapture inputVideo; cv::VideoCapture inputVideo;
Line 122: Line 147:
         break;         break;
 } }
-</doxycode>+</doxycode> |
  
QR Code
QR Code playground:doxycode (generated for current page)