error: (-215:Assertion failed) id < bytesList.rows in function 'drawMarker'












1














this is the code to generate 4 aruco marker with the given id and save it into the same folder .this is the error when i run the same function for generating multiple aruco marker



import numpy
import cv2
import cv2.aruco as aruco
i=1

def aruco_gen(id_aruco, num_pixels):
global i

aruco_dict = aruco.Dictionary_get(aruco.DICT_4X4_50)
print(i)
img = aruco.drawMarker(aruco_dict, id_aruco, num_pixels)


cv2.imshow('frame',img)
cv2.imwrite('ArUco'+str(id_aruco)+'.jpg',img)
i=i+1
cv2.waitKey(0)
cv2.destroyAllWindows()


if __name__ == "__main__":

aruco_dict={0:[10,400],1:[49,400],2:[74,400],3:[190,400],4:[180,400]}


for ar_id,ar_arg in aruco_dict.items():
id_aruco =aruco_dict[ar_id][0]
num_pixels=aruco_dict[ar_id][1]
aruco_gen(id_aruco,num_pixels)
print(id_aruco,num_pixels,ar_id)


this is the error i get when i run the program



 1
10 400 0
2
49 400 1
3



Traceback (most recent call last): File "/home/mighty/Task1.1_test.py", line 98, in
aruco_gen(id_aruco,num_pixels) File "/home/mighty/Task1.1_test.py", line 67, in aruco_gen
img = aruco.drawMarker(aruco_dict, id_aruco, num_pixels) cv2.error: OpenCV(3.4.2)
/io/opencv_contrib/modules/aruco/src/dictionary.cpp:169: error:
(-215:Assertion failed) id < bytesList.rows in function 'drawMarker'



[Finished in 1.7s with exit code 1] [shell_cmd: /usr/bin/env python3 /home/mighty/Task1.1_test.py] [dir: /home/mighty/] [path:
/home/mighty/bin:/home/mighty/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]











share|improve this question





























    1














    this is the code to generate 4 aruco marker with the given id and save it into the same folder .this is the error when i run the same function for generating multiple aruco marker



    import numpy
    import cv2
    import cv2.aruco as aruco
    i=1

    def aruco_gen(id_aruco, num_pixels):
    global i

    aruco_dict = aruco.Dictionary_get(aruco.DICT_4X4_50)
    print(i)
    img = aruco.drawMarker(aruco_dict, id_aruco, num_pixels)


    cv2.imshow('frame',img)
    cv2.imwrite('ArUco'+str(id_aruco)+'.jpg',img)
    i=i+1
    cv2.waitKey(0)
    cv2.destroyAllWindows()


    if __name__ == "__main__":

    aruco_dict={0:[10,400],1:[49,400],2:[74,400],3:[190,400],4:[180,400]}


    for ar_id,ar_arg in aruco_dict.items():
    id_aruco =aruco_dict[ar_id][0]
    num_pixels=aruco_dict[ar_id][1]
    aruco_gen(id_aruco,num_pixels)
    print(id_aruco,num_pixels,ar_id)


    this is the error i get when i run the program



     1
    10 400 0
    2
    49 400 1
    3



    Traceback (most recent call last): File "/home/mighty/Task1.1_test.py", line 98, in
    aruco_gen(id_aruco,num_pixels) File "/home/mighty/Task1.1_test.py", line 67, in aruco_gen
    img = aruco.drawMarker(aruco_dict, id_aruco, num_pixels) cv2.error: OpenCV(3.4.2)
    /io/opencv_contrib/modules/aruco/src/dictionary.cpp:169: error:
    (-215:Assertion failed) id < bytesList.rows in function 'drawMarker'



    [Finished in 1.7s with exit code 1] [shell_cmd: /usr/bin/env python3 /home/mighty/Task1.1_test.py] [dir: /home/mighty/] [path:
    /home/mighty/bin:/home/mighty/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]











    share|improve this question



























      1












      1








      1







      this is the code to generate 4 aruco marker with the given id and save it into the same folder .this is the error when i run the same function for generating multiple aruco marker



      import numpy
      import cv2
      import cv2.aruco as aruco
      i=1

      def aruco_gen(id_aruco, num_pixels):
      global i

      aruco_dict = aruco.Dictionary_get(aruco.DICT_4X4_50)
      print(i)
      img = aruco.drawMarker(aruco_dict, id_aruco, num_pixels)


      cv2.imshow('frame',img)
      cv2.imwrite('ArUco'+str(id_aruco)+'.jpg',img)
      i=i+1
      cv2.waitKey(0)
      cv2.destroyAllWindows()


      if __name__ == "__main__":

      aruco_dict={0:[10,400],1:[49,400],2:[74,400],3:[190,400],4:[180,400]}


      for ar_id,ar_arg in aruco_dict.items():
      id_aruco =aruco_dict[ar_id][0]
      num_pixels=aruco_dict[ar_id][1]
      aruco_gen(id_aruco,num_pixels)
      print(id_aruco,num_pixels,ar_id)


      this is the error i get when i run the program



       1
      10 400 0
      2
      49 400 1
      3



      Traceback (most recent call last): File "/home/mighty/Task1.1_test.py", line 98, in
      aruco_gen(id_aruco,num_pixels) File "/home/mighty/Task1.1_test.py", line 67, in aruco_gen
      img = aruco.drawMarker(aruco_dict, id_aruco, num_pixels) cv2.error: OpenCV(3.4.2)
      /io/opencv_contrib/modules/aruco/src/dictionary.cpp:169: error:
      (-215:Assertion failed) id < bytesList.rows in function 'drawMarker'



      [Finished in 1.7s with exit code 1] [shell_cmd: /usr/bin/env python3 /home/mighty/Task1.1_test.py] [dir: /home/mighty/] [path:
      /home/mighty/bin:/home/mighty/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]











      share|improve this question















      this is the code to generate 4 aruco marker with the given id and save it into the same folder .this is the error when i run the same function for generating multiple aruco marker



      import numpy
      import cv2
      import cv2.aruco as aruco
      i=1

      def aruco_gen(id_aruco, num_pixels):
      global i

      aruco_dict = aruco.Dictionary_get(aruco.DICT_4X4_50)
      print(i)
      img = aruco.drawMarker(aruco_dict, id_aruco, num_pixels)


      cv2.imshow('frame',img)
      cv2.imwrite('ArUco'+str(id_aruco)+'.jpg',img)
      i=i+1
      cv2.waitKey(0)
      cv2.destroyAllWindows()


      if __name__ == "__main__":

      aruco_dict={0:[10,400],1:[49,400],2:[74,400],3:[190,400],4:[180,400]}


      for ar_id,ar_arg in aruco_dict.items():
      id_aruco =aruco_dict[ar_id][0]
      num_pixels=aruco_dict[ar_id][1]
      aruco_gen(id_aruco,num_pixels)
      print(id_aruco,num_pixels,ar_id)


      this is the error i get when i run the program



       1
      10 400 0
      2
      49 400 1
      3



      Traceback (most recent call last): File "/home/mighty/Task1.1_test.py", line 98, in
      aruco_gen(id_aruco,num_pixels) File "/home/mighty/Task1.1_test.py", line 67, in aruco_gen
      img = aruco.drawMarker(aruco_dict, id_aruco, num_pixels) cv2.error: OpenCV(3.4.2)
      /io/opencv_contrib/modules/aruco/src/dictionary.cpp:169: error:
      (-215:Assertion failed) id < bytesList.rows in function 'drawMarker'



      [Finished in 1.7s with exit code 1] [shell_cmd: /usr/bin/env python3 /home/mighty/Task1.1_test.py] [dir: /home/mighty/] [path:
      /home/mighty/bin:/home/mighty/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]








      python python-3.x opencv aruco






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 at 20:21









      Jean-François Fabre

      101k954109




      101k954109










      asked Nov 12 at 20:19









      mighty

      62




      62





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269495%2ferror-215assertion-failed-id-byteslist-rows-in-function-drawmarker%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53269495%2ferror-215assertion-failed-id-byteslist-rows-in-function-drawmarker%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python