CN112546643A - Model car line patrol method and device - Google Patents

Model car line patrol method and device Download PDF

Info

Publication number
CN112546643A
CN112546643A CN202011596327.1A CN202011596327A CN112546643A CN 112546643 A CN112546643 A CN 112546643A CN 202011596327 A CN202011596327 A CN 202011596327A CN 112546643 A CN112546643 A CN 112546643A
Authority
CN
China
Prior art keywords
gray value
value
model car
runway
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011596327.1A
Other languages
Chinese (zh)
Other versions
CN112546643B (en
Inventor
胡义思
陈志芬
余扬帆
王亮
张福明
樊飞
张小翠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Maker Works Technology Co ltd
Original Assignee
Shenzhen Maker Works Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Maker Works Technology Co ltd filed Critical Shenzhen Maker Works Technology Co ltd
Priority to CN202011596327.1A priority Critical patent/CN112546643B/en
Publication of CN112546643A publication Critical patent/CN112546643A/en
Application granted granted Critical
Publication of CN112546643B publication Critical patent/CN112546643B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63HTOYS, e.g. TOPS, DOLLS, HOOPS OR BUILDING BLOCKS
    • A63H17/00Toy vehicles, e.g. with self-drive; ; Cranes, winches or the like; Accessories therefor
    • A63H17/26Details; Accessories
    • A63H17/36Steering-mechanisms for toy vehicles

Landscapes

  • Traffic Control Systems (AREA)

Abstract

The application provides a model car line patrol method and device. The model car line patrol method comprises the steps of obtaining a first reference gray value of a marking line and a gray value coefficient of a runway under a light supplement lamp of a target color, wherein the runway comprises a background and the marking line; collecting a first gray value of the runway under a light supplement lamp of the target color when the model car patrols the runway; according to the first reference gray value and the gray value coefficient, performing normalization processing on the first gray value to obtain a second gray value; if the second gray value is larger than a first threshold value, judging that the model car deviates from the marking line; and calculating the offset of the model car and the marking line, and adjusting the direction of the model car according to the offset so as to enable the model car to run along the marking line. The model car line patrol method can improve the line patrol precision and accuracy of the model car.

Description

Model car line patrol method and device
Technical Field
The application relates to the field of model car line patrol, in particular to a model car line patrol method and device.
Background
The existing model car line patrol method often has the condition of off-line driving, so that the line patrol of the model car fails or the model car collides, which greatly influences the experience of users and is easy to damage the model car.
Disclosure of Invention
In view of the above problems, the present application provides a model car line patrol method, which can improve the accuracy and precision of model car line patrol.
The embodiment of the application provides a model car line patrol method, which comprises the following steps:
acquiring a first reference gray value of the marking line and a gray value coefficient of the runway under a light supplement lamp of a target color, wherein the runway comprises a background and the marking line;
collecting a first gray value of the runway under a light supplement lamp of the target color when the model car patrols the runway;
according to the first reference gray value and the gray value coefficient, performing normalization processing on the first gray value to obtain a second gray value;
if the second gray value is larger than a first threshold value, judging that the model car deviates from the marking line; and
and calculating the offset of the model car from the marking line, and adjusting the direction of the model car according to the offset so as to enable the model car to run along the marking line.
Optionally, the runway further comprises an identification block, and the method further comprises:
acquiring color information of the identification block; and
and adjusting the advancing direction of the model car according to the color information.
Optionally, the obtaining a first reference gray value of the indication line and a gray value coefficient of the runway under the fill light of the target color specifically includes:
respectively collecting a first reference gray value of the marking line, a second reference gray value of the background and a gray value coefficient of the runway under a red light supplement lamp, a blue light supplement lamp, a green light supplement lamp and a white light supplement lamp when the model car patrols the line on the runway;
and taking the light supplement lamp with the maximum difference value between the first reference gray value and the second reference gray value as the light supplement lamp of the target color of the current runway.
Optionally, under each color fill light, the first reference gray value of the sign line, the second reference gray value of the background, and the gray value coefficient of the runway are obtained by:
collecting a third gray value of the background under a preset color fill light, wherein the preset color fill light is one of a red fill light, a blue fill light, a green fill light or a white fill light;
collecting a plurality of fourth gray values of the runway under the preset color light supplement lamp when the model car patrols the runway for multiple times;
averaging a first number of the fourth gray values from small to large to obtain a first average value;
averaging a second number of the fourth gray values from large to small to obtain a second average value;
comparing the difference value between the first average value and the third gray value with the difference value between the second average value and the third gray value, wherein the difference value is the second reference gray value of the background, and the difference value is the first reference gray value of the marking line; and
and calculating the gray value coefficient K according to a formula K of M/| first average value-second average value |, wherein M is an integer larger than 256.
Optionally, the step of obtaining the first reference gray value of the marking line, the second reference gray value of the background, and the gray value coefficient under the fill light of each color further includes:
and if the difference value between the first reference gray value and the second reference gray value is smaller than or equal to a second threshold value, replacing the runway color or the light supplement lamp color to obtain the first reference gray value of the marking line, the second reference gray value of the background and the gray value coefficient again until the difference value between the first reference gray value and the second reference gray value is larger than the second threshold value.
Based on the same inventive concept, the embodiment of the present application further provides a model car line patrol device, which includes:
the learning module is used for acquiring a first reference gray value of the marking line and a gray value coefficient of the runway under a light supplement lamp of a target color, wherein the runway comprises a background and the marking line;
the gray level acquisition module is used for acquiring a first gray level value of the runway under the light supplement lamp of the target color when the model car patrols the runway;
the normalization module is used for performing normalization processing on the first gray value according to a first reference gray value and the gray value coefficient to obtain a second gray value;
the judging module is used for judging that the model car deviates from the marking line if the second gray value is larger than a first threshold value; and
the judging module is also used for calculating the offset of the model car and the marking line, and
and the control module is used for adjusting the direction of the model car according to the offset so as to enable the model car to run along the marking line.
Optionally, the runway further includes an identification block, and the apparatus further includes:
the color identification module is used for acquiring the color information of the identification block;
the control module is further used for adjusting the advancing direction of the model car according to the color information.
Optionally, the learning module includes:
the learning submodule is used for respectively acquiring a first reference gray value of the marking line, a second reference gray value of the background and a gray value coefficient of the runway under a red light supplement lamp, a blue light supplement lamp, a green light supplement lamp and a white light supplement lamp when the model car patrols the runway; and
and the sub-judgment module is used for taking the light supplement lamp when the difference value between the first reference gray value and the second reference gray value is maximum as the light supplement lamp of the target color of the current runway.
Optionally, the learning submodule is specifically configured to:
collecting a third gray value of the background under a preset color fill light, wherein the preset color fill light is one of a red fill light, a blue fill light, a green fill light or a white fill light;
collecting a plurality of fourth gray values of a plurality of positions of the runway under the preset color light supplement lamp when the model car patrols the runway;
averaging a first number of the fourth gray values from small to large to obtain a first average value;
averaging a second number of the fourth gray values from large to small to obtain a second average value;
comparing the difference value between the first average value and the third gray value with the difference value between the second average value and the third gray value, wherein the difference value is the second reference gray value of the background, and the difference value is the first reference gray value of the marking line; and
and calculating the gray value coefficient K according to a formula K of M/| first average value-second average value |, wherein M is an integer larger than 256.
Optionally, the sub-determination module is further configured to determine whether a difference between the first reference gray-scale value and the second reference gray-scale value is smaller than or equal to a second threshold;
the learning submodule is further configured to, if the difference between the first reference gray value and the second reference gray value is smaller than or equal to a second threshold, change a runway color or a fill light color to obtain the first reference gray value of the sign line, the second reference gray value of the background, and the gray value coefficient again until the difference between the first reference gray value and the second reference gray value is larger than the second threshold.
The model car line patrol method provided by the embodiment of the application enables the background and the marking line of the runway to have larger gray value difference under the light supplement lamp by selecting the light supplement lamp with the target color, so that the runway and the marking line are distinguished more easily, the anti-interference capability to ambient light is enhanced, the line patrol precision and accuracy are improved, meanwhile, the obtained gray value is amplified (the multiple of the gray value coefficient is amplified), and the distinguishing precision of the background and the marking line is further improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a block diagram of a model car according to an embodiment of the present application.
Fig. 2 is a flowchart of a model car routing method according to an embodiment of the present application.
Fig. 3 is a flowchart of patrol learning according to the embodiment of the present application.
Fig. 4 is a flowchart of a model car routing method according to still another embodiment of the present application.
Fig. 5 is a schematic structural diagram of a line patrol device according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a line patrol device according to still another embodiment of the present application.
Fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
It should be noted that, for convenience of description, like reference numerals denote like parts in the embodiments of the present application, and a detailed description of the like parts is omitted in different embodiments for the sake of brevity.
Referring to fig. 1, fig. 1 is a block diagram of a model car 100 according to the present application. The model car line patrol method is suitable for line patrol driving of the model car 100 on a track. The runway comprises a background (or a runway background and a road surface background), a marking line and a marking block. The identification block can be arranged at an intersection or a turning intersection so as to control the model car to turn, go straight, turn off and the like according to the identification block. The colors of the background, the marking lines and the marking blocks can be, but are not limited to, white, black, red, blue, green and the like, and the colors of the background, the marking lines and the marking blocks are different from each other. The model car 100 includes a line patrol sensor 10, a color sensor 30, and a controller 50, and the controller 50 is electrically connected to the line patrol sensor 10 and the color sensor 30, respectively. The line patrol sensor 10 comprises a light sensor 11 and a light supplement lamp 13, the light supplement lamp 13 is used for supplementing light to the runway, and the light sensor 11 is used for identifying the background and the marking line of the runway, so that the controller 50 controls the advancing direction of the model car 100 according to the runway information detected by the light sensor 11. The color sensor 30 is used for recognizing the color of the identification block, so that the controller 50 controls the model car to turn, go straight and turn around according to the recognized color.
Optionally, the fill light 13 includes, but is not limited to, a red fill light, a green fill light, a blue fill light, or a white fill light.
In some embodiments, model car 100 further comprises control keys 70, said control keys 70 being electrically connected to said controller 50. The control key 70 can be operated to control the model car to start, shut down, patrol the line, learn patrol the line, switch the color of the light supplement lamp 13, and the like. Furthermore, these functions may be triggered by software instructions. For example, the model car 100 may be triggered to perform line patrol learning or line patrol by double-clicking the control key 70 or holding down the control key 70 for a preset time (e.g., 3 seconds or 5 seconds, etc.). For another example, the control key 70 may be clicked through the through hole or the control key 70 may be pressed for a preset time (e.g., 3 seconds or 5 seconds), so as to trigger the model car 100 to switch the color of the fill-in light 13.
In some embodiments, the model car 100 further comprises an indicator light 90, the indicator light 90 is electrically connected to the controller 50, and the indicator light 90 can comprise a plurality of color states, and the states of the indicator light 90 are switched on, off, flashing and color under the control of the controller 50 to indicate the state of the model car 100. In addition, the various color states of the indicator light 90 can be realized by one indicator light 90, and can also be realized by a plurality of indicator lights 90 with different colors. For example, when in the patrol learning state, a blue indicator light is on or frequently blinks; for another example, when the vehicle is in a line patrol state, a red indicator lamp is turned on or frequently blinks.
The term "line patrol" in this application refers to model cars travelling around a line on a runway.
Referring to fig. 2, an embodiment of the present application provides a model car line patrol method, which includes:
s201, acquiring a first reference gray value of the marking line and a gray value coefficient of the runway under a light supplement lamp of a target color, wherein the runway comprises a background and the marking line;
alternatively, the target color may be, but is not limited to, red, green, blue, or white. That is, the fill light may be a red fill light, a green fill light, a blue fill light, or a white fill light.
The term "gray value" is also referred to as a brightness value, and gray refers to the logarithmic relationship between white and black divided into several levels, which generally range from 0 to 255, white being 255 and black being 0.
Specifically, when the model car patrols the runway, respectively collecting a first reference gray value of the marking line, a second reference gray value of the background and a gray value coefficient of the runway under a red light supplement lamp, a blue light supplement lamp, a green light supplement lamp and a white light supplement lamp; and taking the light supplement lamp with the maximum difference value between the first reference gray value and the second reference gray value as the light supplement lamp of the target color of the current runway.
More specifically, the line patrol sensor of the model car learns the runway with the preset color under the light supplementing lamps with different colors, and acquires a first reference gray value of the marking line with the preset color and a second reference gray value of the background with the preset color under the light supplementing lamps with various colors, wherein the runway with the preset color comprises the background with the preset color and the marking line with the preset color; and judging the difference value of a first reference gray value and a second reference gray value of the runway with the preset color under the light supplementing lamp with each color, and taking the light supplementing lamp with the maximum difference value of the first reference gray value and the second reference gray value as the light supplementing lamp of the target color of the current runway, so as to obtain the light supplementing lamp of the target color of the runway with various preset colors. And amplifying the difference value of the first reference gray value and the second reference gray value of the runway under the target color light supplementing lamp by a preset multiple, so that the difference value is a preset numerical value after being amplified by the preset multiple, and the preset multiple is a gray value coefficient K. Optionally, when the target color fill light is a red fill light, a blue fill light, a green fill light, or a white fill light, the gray-scale coefficient is a gray-scale coefficient of the runway under the red fill light, the blue fill light, the green fill light, or the white fill light. The first reference gray value and the second reference gray value are amplified by K times, so that the line patrol accuracy of the model car can be improved, and the line patrol method of the model car can adapt to more environments.
Alternatively, the preset value may be, but not limited to, an integer multiple of 256, such as 512, 1024, etc.
Referring to fig. 3, fig. 3 is a schematic flow chart of obtaining the first reference gray-scale value of the marking line, the second reference gray-scale value of the background, and the gray-scale value coefficient of the runway under the fill light of each color, or a schematic flow chart of line patrol learning, where the first reference gray-scale value of the marking line, the second reference gray-scale value of the background, and the gray-scale value coefficient of the runway are obtained through the following steps:
in one embodiment, the model car can be triggered to perform the following route walking learning process from S301 to S307 by double clicking the control key 70. In the process of line patrol learning, the color of the light supplement lamp can be switched by long pressing of the control key 70.
S301, collecting a third gray value of the background under a preset color fill light, wherein the preset color fill light is one of a red fill light, a blue fill light, a green fill light or a white fill light;
specifically, under a preset color fill light, such as a red fill light, a blue fill light, a green fill light or a white fill light, the model car is made to patrol on the runway without the marking line, the gray value of the background of the runway is collected for multiple times, and the gray values collected for multiple times are averaged to obtain a third gray value. The number of acquisitions may be, but is not limited to, 6, 8, 10, 12, etc. Optionally, the plurality of gray values may be filtered before averaging, i.e. a minimum value and a first maximum value are removed, and then averaging is performed.
S302, collecting a plurality of fourth gray values of the runway under the preset color light supplement lamp when the model car patrols the runway for multiple times;
specifically, a model car is enabled to run on the runway in an inspection tour mode, a fourth gray value of the runway under the preset color light supplement lamp is collected at intervals of a period of time or a distance, and multiple fourth gray values of the runway are obtained after multiple times of collection. The fourth gray value is the average gray value of the acquisition points during each acquisition, that is, when the acquired gray value is the background, the acquired fourth gray value is the gray value of the background, when the acquired gray value is the marking line, the acquired fourth gray value is the gray value of the marking line, and when the acquired gray value includes the background and the marking line, the acquired fourth gray value is the average gray value of the background and the marking line of the acquisition points.
Alternatively, the number of acquisitions may be, but is not limited to, 50, 62, 80, 90, etc.
S303, averaging a first number of fourth gray values from small to large to obtain a first average value;
specifically, the plurality of fourth gray values are sorted, the fourth gray value with the smallest first number is selected from small to large, and the average value is calculated to obtain the first average value. Alternatively, a maximum value and a first minimum value of the gray values with the minimum first number may be removed, and then the average value may be obtained. Optionally, the first number is less than one fourth of the total number of fourth grayscale values. The first number may be, but is not limited to, 10, 15, 18, etc. Optionally, the first average is any integer between 0-255.
S304, averaging a second number of fourth gray values from large to small to obtain a second average value;
specifically, the plurality of fourth gray values are sorted, a second number of fourth gray values are selected from large to small, and an average value is obtained to obtain a second average value. Alternatively, a maximum value and a first minimum value of the gray values with the largest second number may be removed, and then the average value may be obtained. Optionally, the second number is less than one fourth of the total number of fourth grayscale values. The second number may be, but is not limited to, 10, 15, 18, etc. The second quantity may be the same as or different from the first quantity. Optionally, the second average is any integer between 0-255.
S305, comparing the difference value between the first average value and the third gray value with the difference value between the second average value and the third gray value, wherein the smaller difference value is a second reference gray value of the background, and the larger difference value is the first reference gray value of the marking line; and
specifically, a first difference between the first average value and the third gray value and a second difference between the second average value and the third gray value are calculated, and the magnitude of the first difference and the magnitude of the second difference are compared, wherein the smaller one of the first difference and the second difference is a second reference gray value of the background, and the larger one of the first difference and the second difference is the first reference gray value of the marking line.
S306, calculating the gray-level coefficient K according to a formula K, where M is an integer greater than 256, i.e., M/| the first average value-the second average value |.
Specifically, the absolute value of the difference between the first average value and the second average value is amplified by a preset multiple, so that the difference is amplified by the preset multiple to be a preset value M, and the preset multiple is the gray value coefficient K. Alternatively, M may be any integer greater than 256, for example, M may be, but is not limited to, 512, 1024, 2048, and the like.
Optionally, in some embodiments, the step of line patrol learning further includes:
s307, if the difference value between the first reference gray value and the second reference gray value is smaller than or equal to a second threshold value, replacing the runway color or the light supplement lamp color to obtain the first reference gray value of the marking line, the second reference gray value of the background and the gray value coefficient again until the difference value between the first reference gray value and the second reference gray value is larger than the second threshold value.
Specifically, when the difference between the first reference gray value and the second reference gray value is less than or equal to the second threshold, it is determined that the difference between the background and the marking line is not obvious enough, and the runway color or the fill light color needs to be replaced to obtain the first reference gray value of the marking line, the second reference gray value of the background, and the gray value coefficient again until the difference between the first reference gray value and the second reference gray value is greater than the second threshold. At this time, the failure of the patrol learning can be indicated by blinking the indicator lamp 90 or changing the color of the indicator lamp 90.
Alternatively, the second threshold may be, but is not limited to, 70, 80, 100, 120, 150, etc.
S202, collecting a first gray value of the runway under a light supplement lamp of the target color when the model car patrols the runway;
specifically, a light supplement lamp of a target color is adopted to supplement light to the runway, and a first gray value of the runway under the light supplement lamp of the target color is collected. Optionally, the first gray scale value of the runway under the light supplement lamp of the target color may be collected in real time, or the first gray scale value of the runway under the light supplement lamp of the target color may be collected once every preset time.
S203, normalizing the first gray value according to the first reference gray value and the gray value coefficient to obtain a second gray value;
specifically, the formula is adopted: and normalizing the first gray value to obtain a second gray value, wherein the second gray value is a gray value coefficient (x) (the first gray value-the first reference gray value).
S204, if the second gray value is larger than a first threshold value, judging that the model car deviates from the marking line; and
alternatively, the first threshold may be, but not limited to, one third of a preset value obtained by expanding the difference between the first reference gray value and the second reference gray value by K times, for example: 1024/3, and the first threshold may be other values, and the present application is not limited to this.
Specifically, it is determined whether the second gray scale value is greater than a first threshold, if the second gray scale value is less than the first threshold, it is determined that the model car travels along the sign line without adjusting the traveling direction, and if the second gray scale value is greater than the first threshold, it is determined that the model car deviates from the sign line and the traveling direction of the model car needs to be adjusted, and step S205 is executed.
S205, calculating the offset of the model car and the marking line, and adjusting the direction of the model car according to the offset so that the model car runs along the marking line.
Specifically, the model car can comprise a plurality of line patrol sensors, the offset of the model car from the marking line and the specific position of the model car are determined according to the distance between each line patrol sensor and the marking line, and the running direction of the model car is adjusted according to the offset so that the model car runs along the marking line.
In one embodiment, the number of the line patrol sensors 10 is 4, and four line patrol sensors 10 are arranged at intervals in a direction perpendicular to the traveling direction of the model car. By detecting the distance from the marking line to each of the line patrol sensors 10 of the model car 100, the controller 50 can determine the relative position or offset of the model car from the marking line according to the distance from the marking line detected by each of the line patrol sensors 10, and adjust the driving direction of the model car according to the relative position of the model car from the marking line so that the model car is driven along the marking line. The plurality of line patrol sensors 10 can increase the accuracy of positioning the match-type vehicle 100 and increase the accuracy of line patrol. It should be understood that the number of the line patrol sensors 10 is not limited to 4, and other technical solutions including other numbers of line patrol sensors 10 also belong to the protection scope of the present application.
The model car line patrol method provided by the embodiment of the application enables the background and the marking line of the runway to have larger gray value difference under the light supplement lamp by selecting the light supplement lamp with the target color, so that the runway and the marking line are distinguished more easily, the anti-interference capability to ambient light is enhanced, the line patrol precision and accuracy are improved, meanwhile, the obtained gray value is amplified (the multiple of the gray value coefficient is amplified), and the distinguishing precision of the background and the marking line is further improved. In addition, the model car comprises four line patrol sensors, so that the programming potential of the model car is greatly improved, and the model car can be suitable for more scenes.
Referring to fig. 4, a model car route patrol method according to another embodiment of the present application includes:
s401, acquiring a first reference gray value of the marking line and a gray value coefficient of the runway under a light supplement lamp of a target color, wherein the runway comprises a background, the marking line and an identification block;
specifically, the color of the identification block may be, but is not limited to, white, black, red, blue, green, purple, etc., and the identification block may be disposed at an intersection or a turning intersection so as to control the model car to turn, go straight, turn around, etc. according to the identification block. For example: red for left turn, green for right turn, blue for straight line, purple for head off, etc.
S402, collecting a first gray value of the runway under a light supplement lamp of the target color when the model car patrols the runway;
s403, normalizing the first gray value according to the first reference gray value and the gray value coefficient to obtain a second gray value;
s404, if the second gray value is larger than a first threshold value, judging that the model car deviates from the marking line;
s405, calculating the offset of the model car and the marking line, and adjusting the direction of the model car according to the offset so that the model car runs along the marking line;
s406, acquiring color information of the identification block; and
specifically, the color sensor is used to identify the color information of the identification block, for example, by obtaining the chroma value of the identification block, to determine the color of the identification block. The term "chromaticity value" is also referred to as color, and a color refers to a color value corresponding to the color in different color modes. For example, the corresponding value of red in the RGB color mode is 255, 0, 0; the corresponding values of green in the RGB color mode are 0, 255, 0; blue corresponds to a value of 0, 0, 255 in the RGB color pattern, and black corresponds to a value of 0, 0, 0 in the RGB color pattern.
Alternatively, the number of the color sensors 30 may be, but is not limited to, 4, and the number of the color sensors 30 may be the same as or different from the number of the line patrol sensors 10. When the number of the color sensors 30 is the same as the number of the line patrol sensors 10, the color sensors 30 are provided in one-to-one correspondence with the line patrol sensors 10.
S407, adjusting the advancing direction of the model car according to the color information.
Specifically, the advancing direction of the model car is adjusted according to the acquired color information and the mapping table of the color information and the advancing direction. "traveling direction mapping table"
Referring to fig. 5, an embodiment of the present application further provides a model car routing device 500, which includes:
a learning module 510, configured to obtain a first reference gray value of the indication line and a gray value coefficient of the runway under a fill light of a target color, where the runway includes a background and an indication line;
the gray level acquisition module 520 is configured to acquire a first gray level value of the runway under the light supplement lamp of the target color when the model car patrols the runway;
a normalization module 530, configured to perform normalization processing on the first gray value according to a first reference gray value and the gray value coefficient to obtain a second gray value;
a determining module 540, configured to determine that the model car deviates from the indication line if the second gray value is greater than a first threshold; and
the judging module 540 is further configured to calculate an offset between the model car and the marking line, and
and a control module 550, configured to adjust the direction of the model car according to the offset amount, so that the model car runs along the indication line. Alternatively, the control module 550 may be a controller or a processor, etc.
Referring to fig. 6, in some embodiments, the runway further includes an identification block, and the line patrol apparatus 500 further includes:
a color recognition module 560, configured to obtain color information of the identification block;
specifically, the color recognition module 560 may be, but is not limited to, a color sensor or the like that can recognize colors.
The control module 550 is further configured to adjust the traveling direction of the model car according to the color information.
Referring to fig. 6, in some embodiments, the learning module 510 includes:
the learning submodule 511 is configured to respectively acquire a first reference gray value of the sign line, a second reference gray value of the background, and a gray value coefficient of the runway under a red light supplement lamp, a blue light supplement lamp, a green light supplement lamp, and a white light supplement lamp when the model car patrols the runway; and
and the sub-judgment module 513 is configured to use the light supplement lamp when the difference between the first reference gray value and the second reference gray value is the maximum as the light supplement lamp of the target color of the current runway.
In some embodiments, the learning submodule 511 is specifically configured to:
collecting a third gray value of the background under a preset color fill light, wherein the preset color fill light is one of a red fill light, a blue fill light, a green fill light or a white fill light;
collecting a plurality of fourth gray values of a plurality of positions of the runway under the preset color light supplement lamp when the model car patrols the runway;
averaging a first number of the fourth gray values from small to large to obtain a first average value;
averaging a second number of the fourth gray values from large to small to obtain a second average value;
comparing the difference value between the first average value and the third gray value with the difference value between the second average value and the third gray value, wherein the difference value is the second reference gray value of the background, and the difference value is the first reference gray value of the marking line; and
and calculating the gray value coefficient K according to a formula K of M/| first average value-second average value |, wherein M is an integer larger than 256.
In some embodiments, the sub-determination module 513 is further configured to determine whether a difference between the first reference gray value and the second reference gray value is less than or equal to a second threshold;
the learning sub-module 511 is further configured to, if the difference between the first reference gray value and the second reference gray value is smaller than or equal to a second threshold, change a runway color or a fill-in light color to obtain the first reference gray value of the sign line, the second reference gray value of the background, and the gray value coefficient again until the difference between the first reference gray value and the second reference gray value is greater than the second threshold.
The present application also provides a computer-readable storage medium storing executable program code for causing a computer to execute the line patrol method of the embodiments of the present application.
Referring to fig. 7, the present application further provides an electronic device 600, which includes a processor 610 and a memory 630, where the memory 630 stores program codes executable by the processor 610, and when the program codes are called and executed by the processor 610, the electronic device performs the line patrol method according to the embodiment of the present application.
The memory 630, which is a non-volatile computer-readable storage medium, may be used for storing non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the line patrol method in the embodiments of the present invention. The processor 610 executes various functional applications of the server and data processing by running nonvolatile software programs, instructions and modules stored in the memory 630, that is, implements the line patrol method of the above-described method embodiment.
May include Random Access Memory (RAM), Read-only memory (ROM), electrically erasable programmable Read-only memory (EEPROM), compact disk Read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Furthermore, the method is simple. Any connection is properly termed a computer-readable medium. For example, if software is transmitted from a website, a server, or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, the coaxial cable, the fiber optic cable, the twisted pair, the DSL, or the wireless technologies such as infrared, radio, and microwave are included in the fixation of the medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy Disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The electronic device 600 of the present invention includes, but is not limited to, a model car, a control module of the model car, a line patrol apparatus, and the like.
Reference herein to "an embodiment" or "an implementation" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present application and not for limiting, and although the present application is described in detail with reference to the above preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application.

Claims (10)

1. A model car line patrol method is characterized by comprising the following steps:
acquiring a first reference gray value of the marking line and a gray value coefficient of the runway under a light supplement lamp of a target color, wherein the runway comprises a background and the marking line;
collecting a first gray value of the runway under a light supplement lamp of the target color when the model car patrols the runway;
according to the first reference gray value and the gray value coefficient, performing normalization processing on the first gray value to obtain a second gray value;
if the second gray value is larger than a first threshold value, judging that the model car deviates from the marking line; and
and calculating the offset of the model car from the marking line, and adjusting the direction of the model car according to the offset so as to enable the model car to run along the marking line.
2. The model car routing method according to claim 1, wherein the runway further comprises an identification block, the method further comprising:
acquiring color information of the identification block; and
and adjusting the advancing direction of the model car according to the color information.
3. The model car line patrol method according to claim 1, wherein the obtaining of the first reference gray value of the marker line and the gray value coefficient of the runway under the fill-in light of the target color specifically comprises:
respectively collecting a first reference gray value of the marking line, a second reference gray value of the background and a gray value coefficient of the runway under a red light supplement lamp, a blue light supplement lamp, a green light supplement lamp and a white light supplement lamp when the model car patrols the runway;
and taking the light supplement lamp with the maximum difference value between the first reference gray value and the second reference gray value as the light supplement lamp of the target color of the current runway.
4. The model car line patrol method according to claim 3, wherein the first reference gray value of the sign line, the second reference gray value of the background, and the gray value coefficient of the runway are obtained by performing the following steps for each color fill light:
collecting a third gray value of the background under a preset color fill light, wherein the preset color fill light is one of a red fill light, a blue fill light, a green fill light or a white fill light;
collecting a plurality of fourth gray values of the runway under the preset color light supplement lamp when the model car patrols the runway for multiple times;
averaging a first number of the fourth gray values from small to large to obtain a first average value;
averaging a second number of the fourth gray values from large to small to obtain a second average value;
comparing the difference value between the first average value and the third gray value with the difference value between the second average value and the third gray value, wherein the difference value is the second reference gray value of the background, and the difference value is the first reference gray value of the marking line; and
and calculating the gray value coefficient K of the runway according to a formula K of M/| first average value-second average value |, wherein M is an integer larger than 256.
5. The model car line patrol method according to claim 4, wherein the step of obtaining a first reference gray value of the sign line, a second reference gray value of the background, and a gray value coefficient of the runway for each color fill light further comprises:
if the difference value between the first reference gray value and the second reference gray value is smaller than or equal to a second threshold value, the runway color or the light supplement lamp color is replaced to obtain the first reference gray value of the marking line, the second reference gray value of the background and the gray value coefficient of the runway again until the difference value between the first reference gray value and the second reference gray value is larger than the second threshold value.
6. A model car patrols traditional thread binding putting, its characterized in that includes:
the learning module is used for acquiring a first reference gray value of the marking line and a gray value coefficient of the runway under a light supplement lamp of a target color, wherein the runway comprises a background and the marking line;
the gray level acquisition module is used for acquiring a first gray level value of the runway under the light supplement lamp of the target color when the model car patrols the runway;
the normalization module is used for performing normalization processing on the first gray value according to a first reference gray value and the gray value coefficient to obtain a second gray value;
the judging module is used for judging that the model car deviates from the marking line if the second gray value is larger than a first threshold value; and
the judging module is also used for calculating the offset of the model car and the marking line, and
and the control module is used for adjusting the direction of the model car according to the offset so as to enable the model car to run along the marking line.
7. The model car patrol device according to claim 6, wherein the runway further comprises an identification block, the device further comprising:
the color identification module is used for acquiring the color information of the identification block;
the control module is further used for adjusting the advancing direction of the model car according to the color information.
8. The model car patrol device according to claim 6, wherein the learning module comprises:
the learning submodule is used for respectively acquiring a first reference gray value of the marking line, a second reference gray value of the background and a gray value coefficient of the runway under a red light supplement lamp, a blue light supplement lamp, a green light supplement lamp and a white light supplement lamp when the model car patrols the runway; and
and the sub-judgment module is used for taking the light supplement lamp when the difference value between the first reference gray value and the second reference gray value is maximum as the light supplement lamp of the target color of the current runway.
9. The model car patrol device according to claim 8, wherein the learning submodule is specifically configured to:
collecting a third gray value of the background under a preset color fill light, wherein the preset color fill light is one of a red fill light, a blue fill light, a green fill light or a white fill light;
collecting a plurality of fourth gray values of a plurality of positions of the runway under the preset color light supplement lamp when the model car patrols the runway;
averaging a first number of the fourth gray values from small to large to obtain a first average value;
averaging a second number of the fourth gray values from large to small to obtain a second average value;
comparing the difference value between the first average value and the third gray value with the difference value between the second average value and the third gray value, wherein the difference value is the second reference gray value of the background, and the difference value is the first reference gray value of the marking line; and
and calculating the gray value coefficient K according to a formula K of M/| first average value-second average value |, wherein M is an integer larger than 256.
10. The model car patrol device according to claim 9, wherein the sub-determination module is further configured to determine whether a difference between the first reference grayscale value and the second reference grayscale value is less than or equal to a second threshold;
the learning submodule is further configured to, if the difference between the first reference gray value and the second reference gray value is smaller than or equal to a second threshold, change a runway color or a fill light color to obtain the first reference gray value of the sign line, the second reference gray value of the background, and the gray value coefficient again until the difference between the first reference gray value and the second reference gray value is larger than the second threshold.
CN202011596327.1A 2020-12-29 2020-12-29 Model car line patrol method and device Active CN112546643B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011596327.1A CN112546643B (en) 2020-12-29 2020-12-29 Model car line patrol method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011596327.1A CN112546643B (en) 2020-12-29 2020-12-29 Model car line patrol method and device

Publications (2)

Publication Number Publication Date
CN112546643A true CN112546643A (en) 2021-03-26
CN112546643B CN112546643B (en) 2022-04-29

Family

ID=75032854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011596327.1A Active CN112546643B (en) 2020-12-29 2020-12-29 Model car line patrol method and device

Country Status (1)

Country Link
CN (1) CN112546643B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114274144A (en) * 2021-12-31 2022-04-05 深圳云天励飞技术股份有限公司 Control method of transfer robot and related equipment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0800129A1 (en) * 1996-04-03 1997-10-08 FIAT OM CARRELLI ELEVATORI S.p.A. Industrial truck with manual or automatic mode
CN105868696A (en) * 2016-03-23 2016-08-17 奇瑞汽车股份有限公司 Method and device for detecting multiple lane lines
CN107180228A (en) * 2017-05-02 2017-09-19 开易(北京)科技有限公司 A kind of grad enhancement conversion method and system for lane detection
CN107315515A (en) * 2017-06-20 2017-11-03 努比亚技术有限公司 Color change method, terminal and the computer-readable recording medium of status bar icon
CN109624976A (en) * 2018-12-25 2019-04-16 广州小鹏汽车科技有限公司 A kind of the lane holding control method and system of vehicle
CN110502971A (en) * 2019-07-05 2019-11-26 江苏大学 Road vehicle recognition methods and system based on monocular vision
WO2020029667A1 (en) * 2018-08-09 2020-02-13 Zhejiang Dahua Technology Co., Ltd. Methods and systems for lane line identification
US20200101983A1 (en) * 2018-09-30 2020-04-02 Boe Technology Group Co., Ltd. Method and apparatus for early warning of vehicle offset
CN111046741A (en) * 2019-11-19 2020-04-21 北京汽车股份有限公司 Method and device for identifying lane line
CN111460848A (en) * 2020-04-01 2020-07-28 福州符号信息科技有限公司 Reading equipment capable of identifying bar codes of various materials and color bar codes and identification method
CN111603782A (en) * 2020-06-04 2020-09-01 张洋 Control method and device for trackless toy car

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0800129A1 (en) * 1996-04-03 1997-10-08 FIAT OM CARRELLI ELEVATORI S.p.A. Industrial truck with manual or automatic mode
CN105868696A (en) * 2016-03-23 2016-08-17 奇瑞汽车股份有限公司 Method and device for detecting multiple lane lines
CN107180228A (en) * 2017-05-02 2017-09-19 开易(北京)科技有限公司 A kind of grad enhancement conversion method and system for lane detection
CN107315515A (en) * 2017-06-20 2017-11-03 努比亚技术有限公司 Color change method, terminal and the computer-readable recording medium of status bar icon
WO2020029667A1 (en) * 2018-08-09 2020-02-13 Zhejiang Dahua Technology Co., Ltd. Methods and systems for lane line identification
US20200101983A1 (en) * 2018-09-30 2020-04-02 Boe Technology Group Co., Ltd. Method and apparatus for early warning of vehicle offset
CN109624976A (en) * 2018-12-25 2019-04-16 广州小鹏汽车科技有限公司 A kind of the lane holding control method and system of vehicle
CN110502971A (en) * 2019-07-05 2019-11-26 江苏大学 Road vehicle recognition methods and system based on monocular vision
CN111046741A (en) * 2019-11-19 2020-04-21 北京汽车股份有限公司 Method and device for identifying lane line
CN111460848A (en) * 2020-04-01 2020-07-28 福州符号信息科技有限公司 Reading equipment capable of identifying bar codes of various materials and color bar codes and identification method
CN111603782A (en) * 2020-06-04 2020-09-01 张洋 Control method and device for trackless toy car

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114274144A (en) * 2021-12-31 2022-04-05 深圳云天励飞技术股份有限公司 Control method of transfer robot and related equipment
CN114274144B (en) * 2021-12-31 2024-03-22 深圳云天励飞技术股份有限公司 Control method of transfer robot and related equipment

Also Published As

Publication number Publication date
CN112546643B (en) 2022-04-29

Similar Documents

Publication Publication Date Title
CN105719499B (en) Traffic Sign Recognition test method and device
CN108773373B (en) Method and device for operating an autonomous vehicle
US20180060986A1 (en) Information processing device, road structure management system, and road structure management method
CN110738164B (en) Part abnormity detection method, model training method and device
CN108182383B (en) Vehicle window detection method and device
CN104884898A (en) Navigation system and method of determining a vehicle position
CN101929867A (en) Clear path detection using road model
CN112546643B (en) Model car line patrol method and device
CN103778786A (en) Traffic violation detection method based on significant vehicle part model
JP2012173879A (en) Traffic signal detection apparatus and program therefor
CN109839386B (en) Intelligent camera shooting identification system
CN110335484B (en) Method and device for controlling vehicle to run
CN112100039B (en) Equipment fault alarm method and system
CN110647886A (en) Interest point marking method and device, computer equipment and storage medium
CN112330961B (en) Traffic indication red, yellow and green light image identification method based on time sequence rule
CN107644538A (en) The recognition methods of traffic lights and device
CN111767780A (en) AI and vision combined intelligent hub positioning method and system
CN105575149A (en) Route indicating device and route indicating method
CN112071066A (en) Automatic driving vehicle testing method, judging method and device
CN201859542U (en) Automatic identification system of road traffic sign
CN111680605A (en) Traffic signal lamp identification system and method
CN110334648A (en) Charging pile identifying system and method suitable for robot
CN112164221B (en) Image data mining method, device and equipment and road side equipment
CN114048590B (en) Atmosphere lamp assessment method and system based on human eye visual perception
CN110198439A (en) Method and apparatus for testing the image recognition performance of ADAS camera automatically

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant