Creating a Tensorflow Model Based on Hough Lines












0















So I have a project of creating an autonomous rc car. In order to do virtual training, I have set up a simulator to collect picture data, along with a steering angle. I then use an OpenCV program, using Hough line Detection, to detect the 3 lines on the road. I want to create a model that when images are inputted the output will be a steering angle. Using TensorFlow, I trained a CNN with these images and the result was extremely poor.



What kind of model should I use ?



How should I approach training such images?



Original Simulator Image and
Hough Lines



I can also train the data using the actual data for each line which looks like this for one line detected:




[[[0.0, 63.0, 54.0, 31.0, -0.5925925925925926]]]




And this for 2 lines detected:




[[[0.0, 61.0, 34.0, 32.0, -0.8529411764705882], [41.0, 42.0, 43.0, 77.0, 17.5]]]




The only problem is I don't know how to deal with inputs of variable size. Help?










share|improve this question

























  • I thought you were detecting “the 3 lines on the road”? I can only see two in your Hough Lines image.

    – barny
    Nov 25 '18 at 22:06











  • Call me a boring old-fashioned old fogey if you want, but I'm not so sure as you that a neural network is what you need here. I'd have thought there is a geometric model you can create which might well be easier and also much more predictable when it comes across the curve that it hasn't seen before rather than attempting to train a neural network to give you a steering angle. And note I said "you" because there's no way I'm going to let any neural network steer my car when I don't know what its possible input->output relationships are in every circumstance it might come across.

    – barny
    Nov 25 '18 at 23:28













  • There are 3 possible lines, but sometimes a line is missed and this needs to be accounted for

    – niallmandal
    Nov 26 '18 at 2:10











  • So I guess you need two outputs from your solution: a steering angle, and a signal “Human control necessary” that sounds a klaxon and leaves the driver to make the critical decision where to steer?

    – barny
    Nov 26 '18 at 8:38


















0















So I have a project of creating an autonomous rc car. In order to do virtual training, I have set up a simulator to collect picture data, along with a steering angle. I then use an OpenCV program, using Hough line Detection, to detect the 3 lines on the road. I want to create a model that when images are inputted the output will be a steering angle. Using TensorFlow, I trained a CNN with these images and the result was extremely poor.



What kind of model should I use ?



How should I approach training such images?



Original Simulator Image and
Hough Lines



I can also train the data using the actual data for each line which looks like this for one line detected:




[[[0.0, 63.0, 54.0, 31.0, -0.5925925925925926]]]




And this for 2 lines detected:




[[[0.0, 61.0, 34.0, 32.0, -0.8529411764705882], [41.0, 42.0, 43.0, 77.0, 17.5]]]




The only problem is I don't know how to deal with inputs of variable size. Help?










share|improve this question

























  • I thought you were detecting “the 3 lines on the road”? I can only see two in your Hough Lines image.

    – barny
    Nov 25 '18 at 22:06











  • Call me a boring old-fashioned old fogey if you want, but I'm not so sure as you that a neural network is what you need here. I'd have thought there is a geometric model you can create which might well be easier and also much more predictable when it comes across the curve that it hasn't seen before rather than attempting to train a neural network to give you a steering angle. And note I said "you" because there's no way I'm going to let any neural network steer my car when I don't know what its possible input->output relationships are in every circumstance it might come across.

    – barny
    Nov 25 '18 at 23:28













  • There are 3 possible lines, but sometimes a line is missed and this needs to be accounted for

    – niallmandal
    Nov 26 '18 at 2:10











  • So I guess you need two outputs from your solution: a steering angle, and a signal “Human control necessary” that sounds a klaxon and leaves the driver to make the critical decision where to steer?

    – barny
    Nov 26 '18 at 8:38
















0












0








0








So I have a project of creating an autonomous rc car. In order to do virtual training, I have set up a simulator to collect picture data, along with a steering angle. I then use an OpenCV program, using Hough line Detection, to detect the 3 lines on the road. I want to create a model that when images are inputted the output will be a steering angle. Using TensorFlow, I trained a CNN with these images and the result was extremely poor.



What kind of model should I use ?



How should I approach training such images?



Original Simulator Image and
Hough Lines



I can also train the data using the actual data for each line which looks like this for one line detected:




[[[0.0, 63.0, 54.0, 31.0, -0.5925925925925926]]]




And this for 2 lines detected:




[[[0.0, 61.0, 34.0, 32.0, -0.8529411764705882], [41.0, 42.0, 43.0, 77.0, 17.5]]]




The only problem is I don't know how to deal with inputs of variable size. Help?










share|improve this question
















So I have a project of creating an autonomous rc car. In order to do virtual training, I have set up a simulator to collect picture data, along with a steering angle. I then use an OpenCV program, using Hough line Detection, to detect the 3 lines on the road. I want to create a model that when images are inputted the output will be a steering angle. Using TensorFlow, I trained a CNN with these images and the result was extremely poor.



What kind of model should I use ?



How should I approach training such images?



Original Simulator Image and
Hough Lines



I can also train the data using the actual data for each line which looks like this for one line detected:




[[[0.0, 63.0, 54.0, 31.0, -0.5925925925925926]]]




And this for 2 lines detected:




[[[0.0, 61.0, 34.0, 32.0, -0.8529411764705882], [41.0, 42.0, 43.0, 77.0, 17.5]]]




The only problem is I don't know how to deal with inputs of variable size. Help?







python pandas opencv tensorflow computer-vision






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 28 '18 at 12:47









J...S

3,42911130




3,42911130










asked Nov 25 '18 at 19:31









niallmandalniallmandal

213




213













  • I thought you were detecting “the 3 lines on the road”? I can only see two in your Hough Lines image.

    – barny
    Nov 25 '18 at 22:06











  • Call me a boring old-fashioned old fogey if you want, but I'm not so sure as you that a neural network is what you need here. I'd have thought there is a geometric model you can create which might well be easier and also much more predictable when it comes across the curve that it hasn't seen before rather than attempting to train a neural network to give you a steering angle. And note I said "you" because there's no way I'm going to let any neural network steer my car when I don't know what its possible input->output relationships are in every circumstance it might come across.

    – barny
    Nov 25 '18 at 23:28













  • There are 3 possible lines, but sometimes a line is missed and this needs to be accounted for

    – niallmandal
    Nov 26 '18 at 2:10











  • So I guess you need two outputs from your solution: a steering angle, and a signal “Human control necessary” that sounds a klaxon and leaves the driver to make the critical decision where to steer?

    – barny
    Nov 26 '18 at 8:38





















  • I thought you were detecting “the 3 lines on the road”? I can only see two in your Hough Lines image.

    – barny
    Nov 25 '18 at 22:06











  • Call me a boring old-fashioned old fogey if you want, but I'm not so sure as you that a neural network is what you need here. I'd have thought there is a geometric model you can create which might well be easier and also much more predictable when it comes across the curve that it hasn't seen before rather than attempting to train a neural network to give you a steering angle. And note I said "you" because there's no way I'm going to let any neural network steer my car when I don't know what its possible input->output relationships are in every circumstance it might come across.

    – barny
    Nov 25 '18 at 23:28













  • There are 3 possible lines, but sometimes a line is missed and this needs to be accounted for

    – niallmandal
    Nov 26 '18 at 2:10











  • So I guess you need two outputs from your solution: a steering angle, and a signal “Human control necessary” that sounds a klaxon and leaves the driver to make the critical decision where to steer?

    – barny
    Nov 26 '18 at 8:38



















I thought you were detecting “the 3 lines on the road”? I can only see two in your Hough Lines image.

– barny
Nov 25 '18 at 22:06





I thought you were detecting “the 3 lines on the road”? I can only see two in your Hough Lines image.

– barny
Nov 25 '18 at 22:06













Call me a boring old-fashioned old fogey if you want, but I'm not so sure as you that a neural network is what you need here. I'd have thought there is a geometric model you can create which might well be easier and also much more predictable when it comes across the curve that it hasn't seen before rather than attempting to train a neural network to give you a steering angle. And note I said "you" because there's no way I'm going to let any neural network steer my car when I don't know what its possible input->output relationships are in every circumstance it might come across.

– barny
Nov 25 '18 at 23:28







Call me a boring old-fashioned old fogey if you want, but I'm not so sure as you that a neural network is what you need here. I'd have thought there is a geometric model you can create which might well be easier and also much more predictable when it comes across the curve that it hasn't seen before rather than attempting to train a neural network to give you a steering angle. And note I said "you" because there's no way I'm going to let any neural network steer my car when I don't know what its possible input->output relationships are in every circumstance it might come across.

– barny
Nov 25 '18 at 23:28















There are 3 possible lines, but sometimes a line is missed and this needs to be accounted for

– niallmandal
Nov 26 '18 at 2:10





There are 3 possible lines, but sometimes a line is missed and this needs to be accounted for

– niallmandal
Nov 26 '18 at 2:10













So I guess you need two outputs from your solution: a steering angle, and a signal “Human control necessary” that sounds a klaxon and leaves the driver to make the critical decision where to steer?

– barny
Nov 26 '18 at 8:38







So I guess you need two outputs from your solution: a steering angle, and a signal “Human control necessary” that sounds a klaxon and leaves the driver to make the critical decision where to steer?

– barny
Nov 26 '18 at 8:38














0






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%2f53471105%2fcreating-a-tensorflow-model-based-on-hough-lines%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53471105%2fcreating-a-tensorflow-model-based-on-hough-lines%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

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'