QR code of the third Information Security competition of Southwest Petroleum University

Source: Internet
Author: User

I have been playing this for the past few days. Please send out the QR code program.

The questions are as follows:

The title of the question is a QR code. It seems that you need to use the program to generate a QR code from the above number. The Code is as follows: (implemented based on opencv)

// Because the image is too small, the image is zoomed ten times

 
#include <stdio.h>#include <stdlib.h>#include "cv.h"#include "cvaux.h"#include "cxcore.h"#include "highgui.h"int main(){int t[]={1,1,1,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,1,1,0,1,0,1,1,1,0,1,1,0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,1,1,1,0,1,0,0,1,0,1,0,0,1,0,0,0,1,0,1,1,1,0,1,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,1,1,1,0,1,0,0,0,1,1,0,1,0,1,0,1,1,1,1,0,1,0,1,0,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,0,1,1,0,0,1,0,1,1,1,0,0,1,0,1,0,0,1,0,1,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,1,1,1,0,1,1,1,1,0,0,0,1,1,1,0,1,0,1,0,0,1,0,0,1,1,1,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,1,1,1,1,0,1,0,1,0,1,0,1,1,0,0,0,0,1,0,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,1,0,0,0,1,0,1,0,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,1,0,1,0,1,1,1,0,1,1,0,0,0,0,0,1,0,0,1,0,0,1,0,1,1,1,0,0,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,0,0,0,1,0,1,0,1,1,0,1,0,1,1,1,0,1,1,1,0,0,0,0,0,1,0,1,0,1,0,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,1,1,1,1,0,0,0,1,1,0,0,1};cvNamedWindow("a");IplImage* img=cvCreateImage(cvSize(250,250),IPL_DEPTH_8U,1);int m,n;for(int i=0;i<250;++i)       {for(int j=0;j<250;++j){m=i/10;n=j/10;if(t[n*25+m]==0)((uchar*)(img->imageData+img->widthStep*j))[i]=(char)(255);else((uchar*)(img->imageData+img->widthStep*j))[i]=(char)(0);}}cvShowImage("a",img);cvWaitKey(0);//system("pause");return 0;}

The effect is as follows:

Baidu uploaded the file and scanned it out.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.