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/14 18:59] lprobsth1playground:doxycode [2024/01/21 15:06] (current) – fix language lprobsth1
Line 1: Line 1:
-<doxycode tagfiles="canopen_dictionary_lib" test2.c>+|100% min:1000px 50% 50%>| 
 +^  Dokuwiki/GeSHi  ^  Doxycode 
 +| 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 22: 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");
 } }
-</doxycode> +</file<doxycode tagfiles="canopen_dictionary_lib" test.c>
- +
-<doxycode tagfiles="opencv4.8.0" linenumbers opencv.cpp> +
-#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); +
-    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; +
-+
-</doxycode> +
- +
-<file c [enable_line_numbers="true"test.c>+
 #include "canopen_dictionary.h" #include "canopen_dictionary.h"
    
Line 72: Line 48:
     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| 
- +| 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>
-<code c [enable_line_numbers="true"]>+
 #include "canopen_dictionary.h" #include "canopen_dictionary.h"
    
Line 98: 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");
 } }
-</code> +</file> | <doxycode tagfiles="canopen_dictionary_lib" linenumbers test2.c>
- +
-^ Step 1 ^ Doxycode ^ +
-| 1 | <doxycode  tagfiles="canopen_dictionary_lib" task_runner language="c">+
 #include "canopen_dictionary.h" #include "canopen_dictionary.h"
    
Line 123: Line 95:
    
     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");
 +}
 +</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);
 +    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>
 +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);
 +    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;
 } }
 </doxycode> | </doxycode> |
  
QR Code
QR Code playground:doxycode (generated for current page)