Alex Bell hates it when the designated bike lane he is pedaling down is blocked. So, too, do many cycling New Yorkers. But Mr. Bell hates it so much that he has tried to do something about it: Three years ago he sued U.P.S., targeting the delivery company’s trucks for blocking his bike path, a case he lost that is in its second round of appeals.

Now Mr. Bell is trying another tack — the 30-year-old computer scientist who lives in Harlem has created a prototype of a machine-learning algorithm that studies footage from a traffic camera and tracks precisely how often bike lanes are obstructed by delivery trucks, parked cars and waiting cabs, among other scofflaws. It is a piece of data that transportation advocates said is missing in the largely anecdotal discussion of how well the city’s bus and bike lanes do or do not work.

At a time of intense criticism of New York’s poorly performing public transportation, Mr. Bell has expanded his study to also look at the flow of bus lanes in a city where the fleet operated by the Metropolitan Transportation Authority inches along at an average speed of seven miles per hour, making it the slowest major bus system in the country.

The blocking of bus and bike lanes has become a sore spot among transportation advocates who believe the city’s enforcement efforts are inadequate.